The wsadmin utility can be used to perform a wide variety of administrative tasks. Use the following command to start the wsdamin utility. Following are the locations of the wsadmin utility on Linux or Windows.
# Linux
${WAS_INSTALL_ROOT}/profiles/your_profile/bin/wsadmin.sh
# Windows
${WAS_INSTALL_ROOT}\profiles\your_profile\bin\wsadmin.bat
The wsadmin utility uses the ${WAS_INSTALL_ROOT}/profiles/your_profile/properties/wsadmin.properties file to define:
- Connection type (typically SOAP)
- port (this is typically the deployment managers SOAP port)
- hostname (typically the hostname of the deployment manager)
- language (typically jacl)
com.ibm.ws.scripting.connectionType=SOAP
com.ibm.ws.scripting.port=8879
com.ibm.ws.scripting.host=server1.example.com
com.ibm.ws.scripting.defaultLang=jacl
Username / Password
When invoking the wsadmin utility without any option, if you are not prompted to provide a username and password, this means administrative security is disabled. On the other hand, if you are prompted to provide a username and password, this means administrative security is enabled. In this scenario, refer to our article on how to securely pass a username and password to the wsadmin utility.
When invoking the wsadmin utility without any option, you will be provided with an interactive prompt, like this.
WASX7209I: Connected to process "dmgr" on node DmgrNode01 using SOAP connector; The type of process is: DeploymentManager
WASX7031I: For help, enter: "print Help.help()"
wsadmin>
Disconnecting from the wsadmin utility
Typing "exit" ad the wsadmin prompt will disconnect you from the wsadmin utility.
wsadmin>exit
Connection type (SOAP, RMI, IPC, JSR160RMI, NONE)
Typially, the connection type in ${WAS_INSTALL_ROOT}/profiles/your_profile/properties/wsadmin.properties is set to SOAP
com.ibm.ws.scripting.connectionType=SOAP
The -conntype option can be used to override the default connection type, such as RMI, IPC, JSR160RMI, or NONE. Check out my article on wsadmin connection types.
wsadmin.sh -conntype NONE
Host and Port
Typially, the hostname and SOAP port of the deployment manager will be set in ${WAS_INSTALL_ROOT}/profiles/your_profile/properties/wsadmin.properties.
com.ibm.ws.scripting.host=server1.example.com
com.ibm.ws.scripting.port=8879
The -host and -port options can be used to override the default hostname and port.
wsadmin.sh -host server2.example.com -port 12345
AdminApp, AdminControl, AdminConfig, AdminTask
The wsadmin utility has 4 scripting objects, AdminApp, AdminControl, AdminConfig, and AdminTask. You will use one of these scripting objects when invoking a wsadmin command.Check out my article on AdminApp, AdminControl, AdminConfig, and AdminTask for more information.
Running commands in-line
Instead of getting an interactive prompt, you will almost always want to instead run commands inline. The -c option can be used to run commands inline. Check out my article on running commands inline for more information.
wsadmin.sh -c "print AdminApp.view('myApp')"
Languages (Jacl / Jython)
By default, the wsadmin utility uses the Jython langage. Check out my article on using Jacl or Jython for more information.
SOAP Timeout
By default, the SOAP timeout will be set to 180 seconds (that's 3 minutes). If you have some long running process, you may want to increase the timeout in the soap.client.props file. Check out my article on SOAP Timeout.
com.ibm.SOAP.requestTimeout=180
Generate command using the WebSphere admin console
Some of the wsadmin commands can be generate using the WebSphere admin console. Check out my article on generating wsadmin commands from the WebSphere admin console for more information.
Did you find this article helpful?
If so, consider buying me a coffee over at