Difference between revisions of "Shutdown Windows from Samba"

From Maze's wiki
Jump to: navigation, search
(Created page with '#!/bin/bash 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 n…')
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
#!/bin/bash
+
<pre>
 
+
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`)
+
</pre>
 
 
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
 

Latest revision as of 11:54, 17 June 2010

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