Saturday, March 2, 2013

WLST Script session


Hey everybody,
Today into WLS session, III show you guys how to change OVD or OID ‘searchbase’ configuration using only WLST scripts for automation and remote changes:
Hey hoo, let’s go:
#Connect to any oracle product that has wlst.sh installed. Please note: You don’t need to be at server you want to change, because I am going to connect, from one server to another using WLST scripts:
1
print 'Starting  ThiagoLeoncio metadata update script .... '
#Connecting to OIM Server
1
connect('oim_user','thiagoleonciopwd','t3://thiagoleoncioOIMServer:14000')
#Going to custom environment details related of OIM.
1
2
custom()
cd('oracle.iam')
#This directory “oracle.iam:name=OIMDiagnosticMBean,type=IAMAppRuntimeMBean,Application=oim,ApplicationVersion=11.1.1.3.0″ is the directory that stores , in my case, OVD searchbase result.
1
2
3
cd("oracle.iam:name=OIMDiagnosticMBean,type=IAMAppRuntimeMBean,Application=oim,ApplicationVersion=11.1.1.3.0")
print '======================================'
#just checking if we are into the right place doing a simple ls , wlst script case is ls()
1
2
3
4
5
6
7
8
9
10
11
12
ls()
wls:/oim_domain/custom/oracle.iam/oracle.iam:name=OIMDiagnosticMBean,type=IAMAppRuntimeMBean,Application=oim,ApplicationVersion=11.1.1.3.0> ls()
-r--   ConfigMBean                                  true
-r--   OVDSearchBase                                dc=us,dc=thiagoleoncioserver,dc=com
-r--   ReadOnly                                     false
-r--   RestartNeeded                                false
-r--   SystemMBean                                  false
-r--   eventProvider                                true
-r--   eventTypes                                   java.lang.String[jmx.attribute.change]
-r--   objectName                                   oracle.iam:name=OIMDiagnosticMBean,type=IAMAppRuntimeMBean,Application=oim,ApplicationVersion=11.1.1.3.0
print 'The old value is:'+get("OVDSearchBase")
Return value ‘get’ above: dc=us,dc=thiagoleoncioserver,dc=com
#Setting the new searchbase value
1
2
3
4
5
6
7
8
9
10
11
12
13
14
set("OVDSearchBase","cn=Users,dc=us,dc=thiagoleoncioserver,dc=com")
ls()
wls:/oim_domain/custom/oracle.iam/oracle.iam:name=OIMDiagnosticMBean,type=IAMAppRuntimeMBean,Application=oim,ApplicationVersion=11.1.1.3.0> ls()
-r--   ConfigMBean                                  true
-r--   OVDSearchBase                                cn=Users,dc=us,dc=thiagoleoncioserver,dc=com
-r--   ReadOnly                                     false
-r--   RestartNeeded                                false
-r--   SystemMBean                                  false
-r--   eventProvider                                true
-r--   eventTypes                                   java.lang.String[jmx.attribute.change]
-r--   objectName                                   oracle.iam:name=OIMDiagnosticMBean,type=IAMAppRuntimeMBean,Application=oim,ApplicationVersion=11.1.1.3.0
print '======================================'
print 'The new value is:'+get("OVDSearchBase")
print '======================================'
# disconnecting from OIM server
1
2
disconnect ()
print 'End of script to fix Thiago Leoncio WLST script help!!!! ...'
#exiting from wlst
1
exit()
I hope this helps,
Thiago Leoncio.