Sunday, August 31, 2014

WLST script to change the weblogic admin password

WLST script to change the weblogic admin password

Note: This will work not only for admin server also works for other users present in DefaultAuthenticator

Prepare the shell script to set up the environmental variables and to invoke the wlst

PasswordChange.sh
----------------------------------------

#WL_HOME="Weblogic Home"
WL_HOME=/usr/weblogic/wlserver_10.3"

#JAVA_HOME="java Home"
JAVA_HOME="/usr/java"

# set up common environment
. "${WL_HOME}/server/bin/setWLSEnv.sh"

"${JAVA_HOME}/bin/java"  weblogic.WLST PasswordChange.py

PasswordChange.properties
-------------------------------------------

Weblogic_Admin_URL=t3://weblogic.com:9001
Weblogic_username=weblogic
Weblogic_password=weblogiccurrent
New_Weblogic_password=newPassword
domainName=weblogicdomainname

PasswordChange.py
-------------------------------------------
loadProperties("PasswordChange.properties")
connect(Weblogic_username,Weblogic_password,Weblogic_Admin_URL)
cd('/SecurityConfiguration/'+domainName+'/Realms/myrealm/AuthenticationProviders/DefaultAuthenticator')
cmo.resetUserPassword(Weblogic_username,New_Weblogic_password)
disconnect()
exit()

  • Changes will reflect immediately so no need to restart the server.
  • Update the new password in boot.properties if exist to avoid issue during the server start up.
  • we can also reset the user password through admin console
  • Navigate to security Relams --> myrelam -->users and groups
  • select the user and update the new password


10 comments:

  1. Hello,

    How can I make this script run once every 30 days? Like my script has to change the weblogic console password once every 30 days. Is there a way to do that?

    Regards,
    Sam.

    ReplyDelete
  2. how do you do the changes to managed servers post password change in admin server. is there any automation for that?

    ReplyDelete
  3. NJ casinos now live - JTM Hub
    New Jersey casinos are being regulated and approved for the 천안 출장마사지 first time in January. Learn 의왕 출장안마 more about the state's 나주 출장샵 New Jersey 문경 출장샵 casinos.Jan 21, 서산 출장샵 2021

    ReplyDelete
  4. Respect and I have a keen present: How Much Do House Repairs Cost modern home renovation

    ReplyDelete