Archive for October, 2009

Been using this script to check my servers after maintenance. Just lazy I guess. Remember you must have relevant permissions for the script to execute.

‘—- Start of Script —

strComputer = “PutServer/PCnameHere”

Set ServiceSet = GetObject(”winmgmts:{impersonationLevel=impersonate}!\\” & _
strComputer).ExecQuery _
(”select * from Win32_Service where State=’Stopped’ and StartMode=’Auto’”)

for each Service in ServiceSet
MsgBox Service.Name, 64, “Auto Started Service has Stopped :”
next

If ServiceSet.Count = 0 Then
WScript.echo “No services found meeting query criteria.”
End If

msgbox “Done”