Wednesday, March 5

Reset admin Password using wstl

Try the below scripts and steps ,save the below lines as decrypt.py file

import os
import weblogic.security.internal.SerializedSystemIni
import weblogic.security.internal.encryption.ClearOrEncryptedService

def decrypt(domainHomeName, encryptedPwd):
domainHomeAbsolutePath = os.path.abspath(domainHomeName)
encryptionService = weblogic.security.internal.SerializedSystemIni.getEncryptionService(domainHomeAbsolutePath)
ces = weblogic.security.internal.encryption.ClearOrEncryptedService(encryptionService)
clear = ces.decrypt(encryptedPwd)
print "Decrypted Password:" + clear

try:
if len(sys.argv) == 3:
decrypt(sys.argv[1], sys.argv[2])
else:
print "INVALID ARGUMENTS"
print " Usage: java weblogic.WLST decryptPassword.py "
print " Example:"
print "java weblogic.WLST decryptPassword.py "
except:
print "Unexpected error: ", sys.exc_info()[0]
dumpStack()
raise

2. Set the env by using the below command

source $DOMAIN_HOME/setDomainEnv.sh

3. Take the password encrypted values from $DOAMIN_HOME/servers/AdminServer/security/boot.properties

4. Run the script using below,

java weblogic.WLST <Location of decrypt.py> <domain home> <encrypted password from boot properties file>

No comments:

Post a Comment