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] ] [ -wsadmin_classpath classpath ] [ -help | -? ] [ script_parameters ]
Parameters
-instance
This required parameter specifies the instance that you want to administer with wsadmin. If you specify only this parameter, the script starts an interactive wsadmin session.
-c
This optional parameter specifies 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, 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 specifies 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.
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 wsadmin script invokes the profile scripts in the order that you specify them.
-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, and NONE. The default value is SOAP. 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 that you want 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.
-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.
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.
wsadmin
wsadmin -instance test
wsadmin -conntype SOAP -host as400 -port 8880
wsadmin -conntype RMI -host as400 -port 2809