I have a local script that utilizes WMI to retrieve the software installed on a server (collecting this from Solarwinds via SNMP does not work well and changing my WIndows servers to be monitored via WMI only is not currently an option). I would like to get this script functionality into SAM to retrieve this info from all of my Windows servers. I have zero experience scripting and no test lab to experiment from so I'm a little nervous about the trial and error method I would employ to try and get this to work. I was hoping this would be a pretty simple task for someone who knows what they are doing and at the very least someone could get me pointed in the right direction and help ensure that I "do no harm" . The working local script that I've been using can be seen here. Thanks in advance.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_Product")
For Each objSoftware in colSoftware
Wscript.Echo "Name: " & objSoftware.Name
Wscript.Echo "Version: " & objSoftware.Version
Wscript.Echo "Publisher: " & objSoftware.vendor
Wscript.Echo "Installed: " & objSoftware.InstallDate
Next