This discovers all Microsoft System Center Data Protection Manager 2010 (DPM) servers.
Knowledge Base article:
Summary
This rule runs a script that discovers Data Protection Manager (DPM) servers. Microsoft Operations Manager uses information about the outcome of the discovery process to display status in the State view. This rule does not generate an alert.
if oArgs.Count < 6 Then
call oAPI.LogScriptEvent("DPMServerDiscovery", 12, 1, "Expected 4 arguments. There were only " & oArgs.Count & " arguments. Exiting script.")
Wscript.Quit -1
End If
Set oDiscData = oAPI.CreateDiscoveryData(SourceType, SourceId, ManagedEntityId)
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
'MsgBox("OS INFO:" & objOperatingSystem.Caption & " " & objOperatingSystem.Version)
osversion = objOperatingSystem.Caption & " " & objOperatingSystem.Version
Next
Set objProcessor = objWMIService.Get("win32_Processor='CPU0'")
If installstate = msiInstallStateUnknown or installState = msiInstallStateAbsent then
'MsgBox("Dpm not found")
dpmProductCode = "{8B7C7B81-95C7-40C5-BC22-A66876E0FC43}"
installstate = MsiQueryProductState(dpmProductCode)
End if
If installstate = msiInstallStateUnknown or installState = msiInstallStateAbsent then
'MsgBox("DPM is not Present")
else
'MsgBox("DPM is Present")
dpmversion = MsiGetProductInfo(dpmProductCode)
Set oInst = oDiscData.CreateClassInstance("$MPElement[Name="Microsoft.Windows.SystemCenterDPM2010.DPMServer"]$")
Function MsiQueryProductState(ProductCode)
Dim InstallState
Dim Installer : Set Installer = Nothing
Set Installer = CreateObject("WindowsInstaller.Installer")
InstallState = Installer.ProductState(ProductCode)
MsiQueryProductState = InstallState
Exit Function
End Function
Function MsiGetProductInfo(ProductCode)
Dim InstallInfo
Dim Installer : Set Installer = Nothing
Set Installer = CreateObject("WindowsInstaller.Installer")
InstallInfo = Installer.ProductInfo(ProductCode,"VersionString")
MsiGetProductInfo = InstallInfo
End Function</Script></ScriptBody>
<TimeoutSeconds>1200</TimeoutSeconds>
</DataSource>
</Discovery>