Enable and disable security using scripting
Use scripting to enable or disable application security, global security, administrative security based on the LocalOS registry, and authentication mechanisms.
Before starting this task, wsadmin must be running. See the Start wsadmin article for more information.
The default profile sets up procedures so that we can enable and disable administrative security based on LocalOS registry.
- Use the isAppEnabled command to determine if application security is enabled or disabled...
This command returns a value of true if appEnabled is set to true. Otherwise, returns a value of false.
- Use the isGlobalSecurityEnabled command to determine if administrative security is enabled or disabled...
Returns a value of true if enabled is set to true. Otherwise, returns a value of false.
- Use the setGlobalSecurity command to set administrative security based on the passed in value...
- Jacl...
$AdminTask setGlobalSecurity {-enabled true}- Jython...
AdminTask.setGlobalSecurity ('[-enabled true]')Returns a value of true if the enabled field in the WCCM security model is successfully updated. Otherwise, returns a value of false.
- Use the help command to find out the arguments that you need to provide with this call...
- Jacl...
securityon helpFor example...
Syntax: securityon user password- Jython...
securityon()For example...
Syntax: securityon(user, password)
- Enable administrative security based on the LocalOS registry, as the following example demonstrates:
- Disable administrative security based on the LocalOS registry...
- Enable and disable LTPA and Kerberos authentication. Use the setActiveAuthMechanism command to set Kerberos as the authentication mechanism in the security configuration...
AdminTask.setActiveAuthMechanism('-authMechanismType KRB5')Use the setActiveAuthMechanism command to set LTPA as the authentication mechanism in the security configuration...
AdminTask.setActiveAuthMechanism('-authMechanismType LTPA')Additionally, there are sample scripts located in...
<WAS_ROOT>/bin...on how to enable and disable LTPA authentication. The scripts are:
- LTPA_LDAPSecurityProcs.py (python script)
- LTPA_LDAPSecurityProcs.jacl (jacl script)
The scripts hard code the type of LDAP server and base distinguished name (baseDN). The LDAP server type is hardcoded as IBM_DIRECTORY_SERVER and the baseDN is hardcoded as o=ibm,cn=us.
Related tasks
Set security with scripting
Enable security for the realm
Related
Kerberos authentication commands 
Related information
Getting started with scripting