Difference between revisions of "Shutdown Windows from Samba"

From Maze's wiki
Jump to: navigation, search
 
Line 1: Line 1:
 
<pre>
 
<pre>
#!/bin/bash
+
net rpc SHUTDOWN -f -I <hostIP/name> -U user_name%password
 
 
wks=(`nmap -sL --dns-servers 10.x.x.x,10.x.x.x 10.x.x.x/22, 10.x.x.x.x/23 grep FQDN|cut -d" " -f2 |grep -v -f serverlist`)
 
 
 
for (( i=0; i < "${#wks[@]}"; i++)); do
 
net rpc SHUTDOWN -C "This system was left on after hours and is being shutdown" -f -I "${wks[$i]}" -U user_name%password
 
 
 
done
 
 
</pre>
 
</pre>

Latest revision as of 11:54, 17 June 2010

net rpc SHUTDOWN -f -I <hostIP/name> -U user_name%password