VBscript to check if SCOM agent is installed on a given list of servers

Below scripts takes input list of servers as input and generates the out with list of scom agent installed servers  and also get the details like start mode, current status etc

on error resume next
Set filesys = CreateObject(“Scripting.FileSystemObject”)
set filetxt = filesys.OpenTextFile(“C:\scripts\Server.txt”,1)

do Until filetxt.AtEndOfStream
 name = filetxt.Readline
 strComputer = trim(name)

 Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2”)
 Set colServices = objWMIService.ExecQuery (“Select * From Win32_Service”)

 For Each objService in colServices
 
  if objService.Name = “HealthService” Then
   wscript.echo  strcomputer & ” – ” & objService.Name & ” – ” & objService.State & ” – ” &objService.Startmode
  End If
       
 Next
loop

One thought on “VBscript to check if SCOM agent is installed on a given list of servers

  1. Pingback: Shake Weight review

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s