Reset Recover Weblogic Server Lost Admin Password



Reset Recover Weblogic Server Lost Admin Password

Recently one of our user Sandeep asked for how to recover the lost weblogic admin password. Even I faced the same issue , post surfing in internet .. now i found the ways how to reset and recover . Refer below steps practically that i have implemented and tested in windows and solaris enviroments to overcome the problem.
To reset the password of weblogic admin console, refer the below link:

To recover the password of lost weblogic admin console, follow the below steps ..

1) Copy the below code into notepad and save it as RecoverPassword.java

import weblogic.security.internal.BootProperties;
public class RecoverPassword {
public static void main(String[] args) {
String BPF =
"C:\Weblogic\user_projects\domains\TD1\boot.properties";
BootProperties.load(BPF, false);
BootProperties bootp = BootProperties.getBootProperties();
System.out.println(
"##############################[" + bootp.getOneClient() +
"/" + bootp.getTwoClient() + "]#############################");
}
}
2) Make sure that in the above code you are replacing the “string BPF” with your boot.properties file location.
3) Compile the code as below :
C:Weblogicuser_projectsdomainsTD1>javac -classpath C:Weblogicwlserver_10.0 serverlibweblogic.jar RecoverPassword.java
4)Copy your start up scritpt inside %Domain_dir%/bin/startWebLogic.cmd to your domain directory (i did in C:Weblogicuser_projectsdomainsTD1 ) and rename as recoverPassword.cmd
5)Now edit recoverPassword.cmd as below ..

For Windows :



%JAVA_HOME%binjava %JAVA_VM% -version
#########Custom Code Starts###########
SET CLASSPATH=C:Weblogicuser_projectsdomainsTD1;%CLASSPATH% echo %CLASSPATH%
SET SERVER_CLASS=RecoverPassword
SET doExitFlag=false
#########Custom Code Ends###########
if "%WLS_REDIRECT_LOG%"=="" (

For Solaris :



{JAVA_HOME}/bin/java ${JAVA_VM} -version // this is an existing line
#########Custom Code Starts###########
CLASSPATH=/Weblogic/user_projects/domains/TD1:$CLASSPATH; export CLASSPATH
echo $CLASSPATH
SERVER_CLASS=RecoverPassword; export SERVER_CLASS
doExitFlag=false; export doExitFlag
#########Custom Code Ends###########
if [ "${WLS_REDIRECT_LOG}" = "" ] ; then // this is en existing line
6) Now save the file recoverPassword.cmd and .sh
7) Execute the file recoverPassword.cmd and output as follows ..