Creating Datasource using WLST

connect(‘weblogic’,’weblogic’,’t3://localhost:7001′) edit() startEdit() cd(‘/’) cmo.createJDBCSystemResource(‘PegaRULES’) cd(‘/JDBCSystemResources/PegaRULES/JDBCResource/PegaRULES’) cmo.setName(‘PegaRULES’) cd(‘/JDBCSystemResources/PegaRULES/JDBCResource/PegaRULES/JDBCDataSourceParams/PegaRULES’) set(‘JNDINames’,jarray.array([String(‘jdbc/PegaRULES’)], String)) cd(‘/JDBCSystemResources/PegaRULES/JDBCResource/PegaRULES/JDBCDriverParams/PegaRULES’) cmo.setUrl(‘jdbc:sqlserver://localhost:1433’) cmo.setDriverName(‘com.microsoft.sqlserver.jdbc.SQLServerDriver’) cmo.setPassword(‘pega612’) cd(‘/JDBCSystemResources/PegaRULES/JDBCResource/PegaRULES/JDBCConnectionPoolParams/PegaRULES’) cmo.setTestTableName(‘SQL SELECT 1rnrn’) cd(‘/JDBCSystemResources/PegaRULES/JDBCResource/PegaRULES/JDBCDriverParams/PegaRULES/Properties/PegaRULES’) cmo.createProperty(‘user’)

Continue reading

Create JMS Resources Using WLST

connect(’system’,’weblogic’, ‘t3://localhost:7001′) # Creating a JMS Server edit()startEdit()cd(‘/’)print ‘Creating JMS Server.’cmo.createJMSServer(‘JMSServer0′)cd(‘/JMSServers/JMSServer0′)cmo.addTarget(getMBean(‘/Servers/AdminServer’))activate() # Creating a Module startEdit()cd(‘/’)cmo.createJMSSystemResource(‘JMSSystemResource0′)cd(‘/JMSSystemResources/JMSSystemResource0′)cmo.addTarget(getMBean(‘/Servers/AdminServer’))cmo.createSubDeployment(’subdeployment0′)activate() # Creating Queue startEdit()print

Continue reading

WLST Script to add users, groups and modify roles

connect(‘weblogic’,’weblogic’,’t3://localhost:7001′)edit()startEdit(-1,-1,’false’)serverConfig()cd(‘/SecurityConfiguration/First_Domain/Realms/myrealm/AuthenticationProviders/DefaultAuthenticator’)cmo.createUser(‘faisal’,’weblogic’,”)cmo.groupExists(‘TestGrp’)cmo.createGroup(‘TestGrp’,”)cmo.addMemberToGroup(‘testgrp’,’faisal’)cd(‘/SecurityConfiguration/First_Domain/Realms/myrealm/RoleMappers/XACMLRoleMapper’)cmo.setRoleExpression(”,’Admin’,’Grp(TestGrp)|Grp(Administrators)’)edit()undo(defaultAnswer=’y’, unactivatedChanges=’true’)stopEdit(‘y’)

Continue reading

Import and Export users from Embedded LDAP using WLST

Export connect(‘weblogic’,’weblogic’, ‘t3://localhost:8003′) domainRuntime() cd(‘/DomainServices/DomainRuntimeService/DomainConfiguration/DomainA/SecurityConfiguration/DomainA/DefaultRealm/myrealm/AuthenticationProviders/DefaultAuthenticator’) cmo.exportData(‘DefaultAtn’,’c:/export.ldif’, Properties()) Import connect(‘weblogic’,’weblogic’, ‘t3://localhost:8003′) domainRuntime() cd(‘/DomainServices/DomainRuntimeService/DomainConfiguration/DomainB/SecurityConfiguration/DomainB/DefaultRealm/myrealm/AuthenticationProviders/DefaultAuthenticator’) cmo.importData(‘DefaultAtn’,’c:/export.ldif’, Properties())

Continue reading