Not sure where I got this from but it works most of the time
library.vbs - set this to run on a scheduled task, we have different areas to switch off at different times - this is the library one.
user / password is domain admin usually - thats what I use
On Error Resume Next
Dim oFSO, oTS, sClient, oWindows, oLocator, oConnection, oSys
Dim sUser, sPassword
'set remote credentials
sUser = ""
sPassword = ""
'open list of client names
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oTS = oFSO.OpenTextFile("C:\Shutdown\library.txt")
Do Until oTS.AtEndOfStream
'get next client name
sClient = oTS.ReadLine
'get WMI locator
Set oLocator = CreateObject("WbemScripting.SWbemLocator")
'Connect to remote WMI
Set oConnection = oLocator.ConnectServer(sClient, _
"root\cimv2", sUser, sPassword)
'issue shutdown to OS
' 4 = force logoff
' 5 = force shutdown
' 6 = force rebooot
' 12 = force power off
Set oWindows = oConnection.ExecQuery("Select " & _
"Name From Win32_OperatingSystem")
For Each oSys In oWindows
'close the text file
'WScript.Echo "All done!"
Then you list the machines in a text file (in this case c:\shutdown\library.txt)
This way you can easily omit machines etc..
save this as library.txt