• No results found

Running a Windows command remotely using iSeries Navigator

2. Select Run Windows Command

Figure 4-15 iSeries Navigator: Run Windows Command

3. A dialog box appears requesting the command to submit.

4. Enter the Windows batch command you want to execute on the server.

5. Click OK.

6. When the command has been executed, the standard output from the command is displayed in the Windows Command Results window. Click OK to close it.

4.6.2 Running Windows commands using SBMNWSCMD

The OS/400 command line command SBMNWSCMD (Submit Network Server Command) is run from an OS/400 session to submit batch commands to the Windows server running on the Integrated Server hardware. You can use the SBMNWSCMD command in a command line program to run Windows batch commands unattended from the iSeries server.

To submit a line command to a Windows 2000 server, follow these steps:

1. Type SBMNWSCMD on an OS/400 command line.

2. Press F4. The Submit Network Server Command display appears as in Figure 4-16.

Figure 4-16 SBMNWSCMD command parameters

3. Enter the Windows command you want to execute on the Windows server for the Command parameter.

Submit Network Server Command (SBMNWSCMD) Type choices, press Enter.

Command . . . CMD > 'dir c:\wsv' ...

Server . . . SERVER > IW2003A

Command (not logged) . . . NOLOGCMD ...

Server type . . . SVRTYPE *WINDOWSNT

Command type . . . CMDTYPE *SVRTYPE Authentication domain . . . AUTDMN *PRIMARY Command standard output . . . . CMDSTDOUT *JOBLOG Convert standard output . . . . CVTSTDOUT *YES

4. Enter the Network Server Description name for the Windows server where you want the command to be executed in the Server parameter.

5. Enter *WINDOWSNT for the Server type parameter.

6. Leave *SVRTYPE for the Command type parameter

7. You can choose how your iSeries user profile is authenticated to run the command:

a. *PRIMARY: Your iSeries profile will be authenticated by the domain.

b. *LOCAL: Your iSeries profile will be authenticated by the local server.

c. Domain name: Your iSeries profile will be authenticated by the domain you specify.

8. Command standard output lets you choose where to send the standard output from the Windows command:

a. *JOBLOG: Standard output is written into your joblog.

b. *PRINT: Standard output is written to a spool file.

c. stream-file-path-name: Standard output is written into a file in the Integrated File System (IFS) of the iSeries.

9. Leave Convert standard output as *YES

4.6.3 Guidelines for running the SBMNWSCMD command

When you use SBMNWSCMD (Submit Network Server Command) on the iSeries to remotely submit Windows 2000 server commands, consider these guidelines:

 Do not use the /u (or /unattend) parameter with the Windows 2000 command.

 You can combine Windows 2000 commands into a single command string by using features of the Windows 2000 cmd.exe command interpreter. For example, on the SBMNWSCMD command line, you can enter this command to collect statistics:

net statistics workstation && net statistics server

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 code sets. If the commands return different types of data, SBMNWSCMD may end abnormally with a message indicating that a problem occurred in the data output

conversion. In this case, run the commands separately.

 Do not use characters that are not normally available from the Windows 2000 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 2000. Applications handle the conversion discrepancies differently.

Note: You can prevent the SBMNWSCMD command from logging the command that you send to the server. If the command string contains sensitive data, such as passwords that you do not want logged in your joblog, perform these steps:

1. Type *NOLOGCMD as the command string.

2. When the Command (not logged) parameter appears, enter the command to execute in this field.

The *NOLOGCMD value does not affect data that the Windows 2000 command returns. If the command returns sensitive data, you can use the CMDSTDOUT (Command standard output) parameter to store the output in a secure location, such as an IFS file.

Standard error data always goes to the job log.

 Submit Network Server Command does not initialize your logon environment. It uses environmental variables from the local system environment. Therefore, 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 account on Windows 2000 is mounted on the local server, Submit Network Server Command sets the current directory to your home directory. Otherwise, it tries to use /home/default or the local system drive.

 You can use the SBMNWSCMD command to run Windows 2000 applications as long as they do not require user intervention. The commands run in a background window, not on the Windows 2000 server console.

 You can also run commands that require a yes or no reply to proceed by using input pipe syntax to provide the response. For example, echo y|format f: /fs:ntfs lets the format proceed after the Proceed with Format? question raised by the format command. Notice that the y and the | (pipe symbol) do not have a space between them.

4.7 Removing integrated Windows servers from iSeries

A new CL command was created for OS/400 V5R2 that will remove every iSeries object related to an integrated Windows server. The DLTWNTSVR command removes:

 Network Server Description (NWSD)

 Virtual LAN Line Description

 Virtual LAN TCP/IP Controller Description

 Virtual LAN TCP/IP Device Description

 TCP/IP interface bound to the Virtual LAN Line Description

 All Network Server Storage Spaces linked to the NWSD

 Message queue created for integrated Windows server event log To run this command, type:

DLTWNTSVR NWSD(nwsdname)

If you will no longer be running integrated Windows server on the iSeries you can also delete the license program 5722WSVIBM iSeries Integration for Windows Server.

To remove the license program, type:

DLTLICPGM LICPGM(5722WSV)