I inherited a script running on Windows Server 2003 that I need to port to Windows Server 2008. The current script is:
strComputer = "servernamexyz"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown)}!\\" & _
strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("SELECT * FROM Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.Win32Shutdown(12)
Next
How do I convert this to run on Windows Server 2008? Thanks!