A simple little script to check if a service is running or not on a remote system. I'd like to be able to maybe pop up a message saying not to leave the field blank and then end or even better would be to pop the message and then return to the field that was left blank.
Thanks!
[!]The AutoSavers![/!]
Thanks!
Code:
On Error Resume Next
Dim strComputer
Dim strService
strComputer = InputBox("Enter the name of the Computer:","Service Checker")
strService = InputBox("Enter the name of the Service:","Service Checker")
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Service Where Name = '" & strService & "'")
For Each objItem in colItems
Msgbox "Service Name: " & objItem.Name & VBNewLine & "State: " & objItem.State
Next
[!]The AutoSavers![/!]