Syntax and parameters
This page describes the syntax and parameters of the wsadmin command.
Syntax
wsadmin -instance instance [ -c 'command' | -f scriptfile ] [ -javaoption option ] [ -lang lang ] [ -p propertiesfile ] [ -profile scriptfile ] [ -conntype SOAP | RMI | JMS | NONE [ -host host ] [ -port port ] [ -user userid ] [ -password password ] ] [ -wsadmin_classpath classpath ] [ -help | -? ] [ script_parameters ]Parameters
-instance
This parameter is required if you a working with a non-default instance. If you do not specify a value for this parameter, wsadmin uses the default instance.-c
This optional parameter designates a single command to run. If you specify this parameter, wsadmin runs the command that you enter and then returns control to the Qshell prompt. To run multiple commands, you can specify a -c parameter for each command that you want to run. The commands run in the order in which they are listed.-f
This optional parameter designates the source of the script and a script to run. If you specify this parameter, wsadmin runs the script that you specify and then returns you to the Qshell prompt.-javaoption
This optional parameter is available in versions 5.0.2 and later. The value option specifies a valid Java standard or non-standard option. You can include more than one -javaoption parameter when you run the wsadmin command.-lang
Because Jacl is the only supported scripting language, you do not need to specify this parameter.-p
This optional parameter specifies a properties file to load. Three properties files are loaded before any files specified with -p.
- The first file is the wsadmin.properties file in this directory:
- WebSphere Application Server: /QIBM/UserData/WebAS5/Base/instance/properties/wsadmin.properties
- WebSphere Application Server Network Deployment: /QIBM/UserData/WebAS5/ND/instance/properties/wsadmin.properties
where instance is the name of your WebSphere Application Server instance.
- The second file is /home/QEJBSVR/wsadmin.properties. This file is not shipped with WebSphere Application Server.
- The third file is the file specified by the WSADMIN_PROPERTIES environment variable. This variable is not set by WebSphere Application Server.
If you specify the -p parameter, the specified properties file overrides properties in the instance default file and the user default file. You can specify the -p parameter multiple times. If you do, the properties files are invoked in the order specified. For example, if the com.ibm.ws.scripting.port property is specified in the instance default file, the user default, and a custom properties file that you specify with the -p parameter, the script uses the value in the custom properties file.
-profile
This optional parameter specifies a profile script. The profile script runs before other commands or scripts. If you specify -c, the profile runs before the single command. If you specify -f, the profile runs before the script. If you do not specify -c or -f, wsadmin runs the commands in the profile and then starts an interactive wsadmin session. You can specify multiple -profile parameters. If you do, the profile scripts are invoked in the order specified.-conntype
This optional parameter specifies to type of connection to use to connect to the application server that you want to administer. The valid values for the conntype parameter are SOAP, RMI, JMS, and NONE. The default value is SOAP. (JMS is not a supported connection type in the current version of WebSphere Application Server.) The -conntype parameter determines which port, if any, is used to connect to the server. If you specify NONE as the conntype parameter, only the $AdminApp commands are available.-host
This optional parameter specifies the host name of the system running the application server you wish to administer. If you do not specify this parameter, the host name defaults to localhost.-port
If you specify the -conntype parameter, you can specify the port number to use to connect to the remote application server. For example, if you use a SOAP connection, specify the SOAP port for the application server you want to administer. If you do not specify this parameter, the script uses the value specified for the com.ibm.ws.scripting.port property in the wsadmin.properties file for your instance, if that property exists. If the property does not exist in any properties file specified explicitly or implicitly for the wsadmin script, an error occurs. When an instance is created, the wsadmin.properties file is updated with the SOAP and RMI connector ports for the instance. For the default WebSphere Application Server instance, these ports are 8880 for SOAP and 2809 for RMI. For the default WebSphere Application Server Network Deployment instance, these ports are 8879 for SOAP and 9809 for RMI.-user
If security is enabled for your WebSphere Application Server cell, this is a required parameter. The value userid specifies a valid iSeries user profile.-password
If security is enabled for your WebSphere Application Server cell, this is a required parameter. The value password specifies the password for the user profile specified by the -user parameter.-wsadmin_classpath
This optional parameter makes additional classes available to your scripting process. The value classpath specifies the classpath that contains the classes that you want wsadmin to access. The specified classpath is added to the classloader for the scripting process. You can also specify this option in a wsadmin.properties file with the com.ibm.ws.scripting.classpath property. The -wsadmin_classpath parameter overrides any value specified in wsadmin.properties.-help or -?
Optional argument that provides syntax help.script_parameters
If you specify the -f parameter to run a script, you can include that script's parameters in the wsadmin command.
Examples
The following examples demonstrate correct syntax. In these examples, mymachine is the name of the host on which server containing the SOAP or RMI connector is running. The port is specified in the wsadmin.properties file by com.ibm.ws.scripting.port.
- SOAP connection to the default WebSphere Application Server instance on the local host
wsadmin- SOAP connection to the WebSphere Application Server instance test on the local host
wsadmin -instance test- SOAP connection with port 8880 to the as400 host
wsadmin -conntype SOAP -host as400 -port 8880- RMI connection with port 2809 to the as400 host
wsadmin -conntype RMI -host as400 -port 2809