Guidelines for submitting remote commands
To remotely submit integrated Windows server commands, keep these guidelines
in mind:
Note: Many of the SBMNWSCMD parameters discussed
in this section are not available when running Windows commands by using iSeries™ Navigator. If you need to use a parameter that iSeries Navigator
does not support, then you must use Submit Network Server Command (SBMNWSCMD)
directly.
- The requested command is run under the Windows console command "cmd.exe."
SBMNWSCMD will not return control to its caller until the command has finished
running on Windows and the cmd.exe program terminates.
- The authentication domain field of SBMNWSCMD indicates the Windows domain
where your user ID is to be authenticated. The default, *PRIMARY, logs on
to the primary domain of the server, if the server is a domain member. *LOCAL
logs on to the server itself. The name of a trusted domain may also be specified.
- The QSECOFR user profile is handled differently than all other user profiles.
User authentication is not performed on Windows when SBMNWSCMD is run by the
QSECOFR profile. The requested Windows command is run under the Windows Local
System Account. The Local System Account is used even if the QSECOFR profile
is enrolled. The Local System Account does not have a password and lacks network
access rights.
- Do not use the "/u" parameter with the Windows "cmd" command.
- SBMNWSCMD has limited support of Kerberos v5 authentication. Kerberos
will only be used when the LCLPWDMGT user profile attribute is *NO. See SBMNWSCMD and file level backup support for Kerberos v5 and EIM.
- The Remote Command service and SBMNWSCMD are able to distinguish between
ASCII multi-byte and unicode output data and convert them as appropriate.
- You can combine integrated Windows server commands into a single command
string by using features of the Windows "cmd.exe" command interpreter. For
example, on the SBMNWSCMD command line, you can enter net statistics workstation && net statistics server to collect
statistics. However, commands that you combine in a single SBMNWSCMD request
should not return mixed data (for example, a combination of ASCII and Unicode
data), or data in mixed codesets. If the commands return different types of
data, SBMNWSCMD may end abnormally with a message which indicates "a problem
occurred in the data output conversion." In that case, run the commands separately.
- Do not use characters that are not normally available from the integrated
server keyboard. In rare cases, an EBCDIC character in the active jobs coded
character set may not have an equivalent in the active code page on Windows.
Each different Windows application will give different conversion results.
- The Submit Network Server Command does not completely initialize your
logon environment. The user's environment variables are set, but may not
be completely equal to those provided by an interactive logon. Thus, environmental
variables that an interactive logon normally sets to user-specific values
may not exist or may be set to system default values. Any scripts or applications
that rely on user-specific environmental variables may not operate correctly.
- If the home directory for your user ID on the integrated server is mounted
on the local server, the Submit Network Server Command sets the current directory
to your home directory. Otherwise, it tries to use /home/default or the local
system drive.
- If the Load User Profile (LODUSRPRF) keyword is *YES, and if
a user profile exists, SBMNWSCMD will attempt to load your Windows profile.
You can then use commands that use or alter profile dependencies. However,
there is no indication of profile load failures, beyond event log messages
that may be produced by Windows. A windows profile can only be active in one
Windows Logon session.
- You can use SBMNWSCMD to run integrated server applications as long as
they do not require user intervention. The commands run in a background window,
not on the integrated server console. If an application requests user intervention,
such as popping up a message window, then SBMNWSCMD will hang, waiting for
the command to complete - but no intervention is possible. If you end SBMNWSCMD
on i5/OS™, it will attempt to end the hung Windows command. The background
command stops whether GUI or console based.
- You can also run commands that require a yes or no reply to proceed. You do this by using input pipe syntax
to provide the response. For example, echo y|format
f: /fs:ntfs will let the format proceed after the Proceed with Format question raised by the format command. Note that
the "y" and the pipe symbol "|" do not have a space between them. However,
not all Windows batch commands support the piping of input (for example,
the "net" command). Attempts to pass a default response may not be possible.
- You can prevent SBMNWSCMD from logging the command. If the command string
contains sensitive data, such as passwords, that you do not want logged in
error messages, do the following steps:
- Specify *NOLOGCMD as the command string.
- When the Command (not logged) field appears,
enter the command to run in this field.
Note, however, that the *NOLOGCMD option does not affect data that the
command returns. If the command returns sensitive data, you can use the command
standard output (CMDSTDOUT) parameter to store the output in a secure location,
such as an integrated file system file.
- You can direct standard output from the command to your job log (*JOBLOG), to a spool file (*PRINT), or to an integrated file system (IFS) object. Standard error
data always goes to the job log.
When you specify *PRINT, the Work with
Spool File (WRKSPLF) display shows SBMNWSCMD in the User Data field for the
spooled file. If you select option 8 to display the attributes, the names
of the specified integrated server and Windows command appear in the user-defined
data field.
When you specify an integrated file system object, the path
name must already exist. If the integrated file system object name does not
exist, SBMNWSCMD creates it.
- In the Convert standard output field, you
can specify (*YES) to convert output from the
Windows code set to the coded character set identifier (CCSID) of the i5/OS job.
New IFS files will be created with the job CCSID. Output directed
to an existing IFS object is converted to the IFS object CCSID. Output directed
to a new member of an existing file in the /QSYS.LIB file system is converted to the existing file CCSID.
- If Convert standard output is (*NO), the Windows standard output
will be written to the IFS object, or spool file, with CCSID conversion.