Of course I can do it by filling the name of the machines But what I really need is to check that some machines might still be on (they all should be due to policy settings be off or sleeping) & power it off Anybody knows a nice script that could do it? That one did not work as expected (anybody could correct me - in fact it shutdown the machine I was running it from!): Code: 1..254 | foreach-object { (new-object System.Net.Networkinformation.Ping).Send("10.0.10.$_") } | where-object {$_.Status -eq "success"} | foreach-object { psshutdown -s \\$_ } Also checked this, but the output is not easily fed to anything else for processing
a bit late but... shotgun approach I used in my college days on Win2k students used to stampede out of the J-block computer lab and leave them all on most were pre-atx so you couldn't just hit the power switch and get controlled shutdowns got gold stars from hot Asian teachers for doing this for them Code: for /l %%a in (1,1,254) do ( start "" /b shutdown.exe /m \\192.168.1.%%a /s /t 0 /f ) first versions called shutdown.exe directly which took forever to timeout if the machine was already off so in came start /b to just fire-and-forget doing this from memory so syntax may be off edit - forgot that with at psus then had to go around the lab and hit switches - but everything said "now safe to turn off your computer" by then