Use > Server Automation > SA Global Shell > Global Shell examples > Running native programs on managed servers with rosh

Running native programs on managed servers with rosh

The next two rosh commands run the dir and ipconfig MSDOS commands on the Windows server named abc.opsware.com. Note that the native MSDOS commands are enclosed in quotes. Because the server name and user (login) can be inferred from the current working directory, the first rosh command omits the -n and -l options, as shown in the following code:

cd /opsw/Server/@/abc.opsware.com/files/Administrator
rosh "dir & ipconfig"
. . .
cd /home/jdoe
rosh -n abc.opsware.com -l Administrator "dir & ipconfig"

 

Run the ipconfig command on abc.opsware.com and redirect the output to a file in home directory of jdoe in the OGFS:

rosh -n abc.opsware.com -l Administrator "ipconfig" \
> /home/jdoe/ipconfig_ouptput.txt
 

On the UNIX server named m256.opsware.com, run the uname and ls commands as root:

rosh -n m256.opsware.com -l root "uname -a; ls /tmp"

 

Within a for loop in bash, run the MSDOS ipconfig command on each server in the All Windows device group:

cd /opsw/Group/Public/All\ Windows\ Servers/@/Server
 
for SERVER_NAME in *
do
   echo ............. $SERVER_NAME ............
   rosh -n $SERVER_NAME -l Administrator "ipconfig"
   echo ""
done