July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.
ArrComputer = Array("Computer1, Computer2, Computer3") ArrServices = Array("Service1", "Service2", "Service3", "Service4") For Each strComputer In ArrComputer Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_Service") For Each objItem in colItems For Each Service In ArrServices If Service = objItem.DisplayName Then Wscript.echo "DisplayName: " & objItem.DisplayName Wscript.echo "State: " & objItem.State & VbCrLf End If Next Next Next
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.