Submit Network Server Command (SBMNWSCMD)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Submit Network Server Command (SBMNWSCMD) command submits a command to run on the designated server. For SVRTYPE(*WINDOWS) or (*WINDOWSNT), command output is directed as specified by the CMDSTDOUT parameter. For all other types, command output is directed to the job log of the job that issues the command.

Top

Parameters

Keyword Description Choices Notes
CMD Command Character value, *NOLOGCMD Required, Positional 1
SERVER Server Character value Required, Positional 2
NOLOGCMD Command (not logged) Character value Optional
SVRTYPE Server type *NWSUSRA, *NWSA, *WINDOWS, *NETWARE, *WINDOWSNT Optional
CMDTYPE Command type *SVRTYPE, *WINDOWS, *NETWARE, *WINDOWSNT Optional
LODUSRPRF Load user profile *YES, *NO Optional
AUTDMN Authentication domain Character value, *PRIMARY, *LOCAL Optional
CMDSTDOUT Command standard output Path name, *JOBLOG, *PRINT Optional
CVTSTDOUT Convert standard output *YES, *NO Optional
Top

Command (CMD)

Specifies the command submitted to the network server. The syntax of the command string specified for this parameter is not checked.

*NOLOGCMD
Specifies the user wants to submit a command string that is not logged in the joblog. This is useful if the command string contains sensitive data such as passwords. If *NOLOGCMD is specified, a command string must be entered on the NOLOGCMD parameter.
command
The command string that is to be submitted to the network server. This command string will be shown in the joblog.

This is a required parameter.

Top

Server (SERVER)

Specifies the name of the server to which the command is submitted.

This is a required parameter.

Top

Command (not logged) (NOLOGCMD)

Specifies the command string to be submitted to the network server. This command string will not be echoed to the joblog. Use this parameter to submit commands that contain sensitive data such as passwords. This parameter is required if, and is only allowed when, CMD(*NOLOGCMD) is specified.

Note: Since the command is being executed on a server, the presence of this option does not prevent the server from returning the command string as part of the output data. Thus, depending on the command, it may still be returned and displayed in the job log or spool file.

Top

Server type (SVRTYPE)

Specifies the type of server to which the command is sent.

*NWSUSRA
The server type specified in the network server attributes (CHGNWSUSRA command) for the user profile running the SBMNWSCMD is used.
*NWSA
The server type specified in the network server attributes (CHGNWSA command) is used.
*WINDOWS or *WINDOWSNT
The server type is Windows. Only Windows commands will run on a local Windows server.

Note: *WINDOWS should be used in V5R4 and later releases. The *WINDOWSNT value is supported for compatibility with releases prior to V5R4.

*NETWARE
The server type is NetWare. Only NetWare commands can be sent to a NetWare server.
Top

Command type (CMDTYPE)

Specifies the type of command string specified in the CMD parameter. This is used by the system to determine what type of processing needs to occur for the command string.

Note: This parameter is ignored.

*SVRTYPE
The command string is processed based on the type of server specified in the SVRTYPE parameter. If the server is a NetWare server, the command string is assumed to be a NetWare command. If the server is a *WINDOWS or a *WINDOWSNT server, the command string is assumed to be a Windows command.
*WINDOWS or *WINDOWSNT
The command string is a Windows command.

Note: *WINDOWS should be used in V5R4 and later releases. The *WINDOWSNT value is supported for compatibility with releases prior to V5R4.

*NETWARE
The command string is a NetWare command.
Top

Load user profile (LODUSRPRF)

Specifies whether or not to load the user profile on the remote server as part of the login environment.

Note: This parameter is only valid when SVRTYPE(*WINDOWS) or (*WINDOWSNT) is specified.

*YES
Load the user profile.
*NO
Do not load the user profile.
Top

Authentication domain (AUTDMN)

Specifies the Windows domain where the user is authenticated.

Note: This parameter is only valid when SVRTYPE(*WINDOWS) or (*WINDOWSNT) is specified.

*PRIMARY
The user is authenticated on the primary domain of the server.
*LOCAL
The user is authenticated on the local server.
'domain-name'
Specify the domain name where the user is authenticated.
Top

Command standard output (CMDSTDOUT)

Specifies where the standard output returned from the command is to be stored, if any exists. Standard output can be written to the job log of the job that issues this command, it can be written to a spooled file, or it can be written to a file. The standard error returned from the command is always directed to the job log of the job that issues this command, if any exists.

Note: This parameter is only valid when SVRTYPE(*WINDOWS) or (*WINDOWSNT) is specified.

*JOBLOG
The standard output of the network server command is directed to the job log of the job that issues this command. It shares the job log with the standard error output of the network server command. Both may be mixed in the job log, depending on the order by which the command writes standard output and standard error information.
*PRINT
The standard output of the network server command is directed to a spooled file. If CVTSTDOUT(*YES) is specified, certain control characters such as line feeds and carriage returns are converted to new lines and other non-displayable control characters such as highlight and underscore are converted to blanks.
'stream-file-path-name'
Specify the path name of the stream file to which the standard output of the network server command is directed. The specified path must exist. If the stream file doesn't exist, it is created. If the stream file exists, all data is overlaid. Additional information about path name is in the Integrated file system information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter book.
Top

Convert standard output (CVTSTDOUT)

Specifies whether the standard output will be converted from the server's code set to the CCSID of the i5/OS user profile that submitted the command. For binary output, CVTSTDOUT(*NO) should be specified.

Note: This parameter is only valid when CMDSTDOUT(*PRINT) or CMDSTDOUT(stream-file-path-name) is specified.

*YES
The output is converted from the server's code set to the CCSID of the i5/OS user profile that submitted the command.
*NO
The output is not converted from the server's code set.
Top

Examples

Example 1: Submitting a Windows Command

SBMNWSCMD   CMD('net config server')  SERVER(WINSVR)
            CMDSTDOUT(*JOBLOG)

This command will display the Windows Server service settings on the Windows server WINSVR. Standard output from the command is returned to i5/OS and directed to the job log.

Example 2: Submitting a NetWare command

SBMNWSCMD   CMD('CONFIG')  SERVER(NTW01)  SVRTYPE(*NETWARE)

This command submits the NetWare CONFIG command to run on the server named NTW01. Output is returned to the job log.

Top

Error messages

*ESCAPE Messages

CPFA43F
Network server command not submitted.
CPFA46C
Unable to complete command processing on server &1.
CPFA46F
Network server description &1 not found.
Top