SBMNWSCMD (Submit Network Server Command)

SBMNWSCMD Command syntax diagram

 

Purpose

The Submit Network Server Command (SBMNWSCMD) command submits a command to run on the designated server. For SVRTYPE(*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 this command.

Restriction: Users must have *JOBCTL special authority to use this command.

 

Required Parameters

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

*NOLOGCMD: Specifies that 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 to be submitted to the network server. This command string will be shown in the joblog.

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

 

Optional Parameters

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 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.

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

*NWSUSRA: The server type specified in the network server user attributes (CHGNWSUSRA command) for the user profile running the SBMNWSCMD is used.

*NWSA: The server type specified in the system network server attributes (CHGNWSA command) is used.

*NETWARE: The server type is NetWare. Only NetWare commands will run on a NetWare server.

*WINDOWSNT: The server type is Windows NT. Only Windows NT commands will run on a Windows NT server.

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.

*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 *WINDOWSNT server, the command string is assumed to be a Windows NT command.

*NETWARE: The command string is a NetWare command.

*WINDOWSNT: The command string is a Windows NT command.

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 will always be directed to the job log of the job that issues this command if any exists.

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

*JOBLOG: The standard output of the network server command will be 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 will be directed to a spooled file. 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.

'file-path-name': Specify the path name of the file to which the standard output of the network server command will be directed. The specified path must exist. If the file doesn't exist, it will be created. If the file exists, all data will be overlaid. Additional information about path name is in the Integrated File System Introduction topic in the Information Center.

CVTSTDOUT
Specifies whether the standard output will be converted from the server's code set to the CCSID of the OS/400 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(file-path-name) is specified.

*YES: The output will be converted from the server's code set to the CCSID of the OS/400 user profile that submitted the command.

*NO: The output will not be converted from the server's code set.

AUTDMN
Specifies the Windows NT domain where the user is authenticated.

Note: This parameter is only valid when SVRTYPE(*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.

Examples for SBMNWSCMD

Example 1: 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.

Example 2: Submitting a Windows NT 'net config server' command

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

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

Error messages for SBMNWSCMD

*ESCAPE Messages

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