DPM 2010 server discovery

Microsoft.Windows.SystemCenterDPM2010.DPMServerDiscovery (Discovery)

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.

Element properties:

TargetMicrosoft.Windows.Server.Computer
EnabledTrue
Frequency86400
RemotableFalse

Object Discovery Details:

Discovered Classes and their attribuets:

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.TimedScript.DiscoveryProvider Default

Source Code:

<Discovery ID="Microsoft.Windows.SystemCenterDPM2010.DPMServerDiscovery" Enabled="true" Target="Windows!Microsoft.Windows.Server.Computer" ConfirmDelivery="false" Remotable="false" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="Microsoft.Windows.SystemCenterDPM2010.DPMServer">
<Property TypeID="Microsoft.Windows.SystemCenterDPM2010.DPMServer" PropertyID="DPMVersion"/>
</DiscoveryClass>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
<IntervalSeconds>86400</IntervalSeconds>
<SyncTime/>
<ScriptName>DPMServerDiscovery.vbs</ScriptName>
<Arguments>0 $MPElement$ $Target/Id$ $Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$ $Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetbiosComputerName$ $Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetbiosDomainName$</Arguments>
<ScriptBody><Script>SetLocale("en-us")
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oArgs = WScript.Arguments

if oArgs.Count &lt; 6 Then
call oAPI.LogScriptEvent("DPMServerDiscovery", 12, 1, "Expected 4 arguments. There were only " &amp; oArgs.Count &amp; " arguments. Exiting script.")
Wscript.Quit -1
End If

SourceType = oArgs(0)
SourceId = oArgs(1)
ManagedEntityId = oArgs(2)
TargetComputer = oArgs(3)
NetbiosComputerName = oArgs(4)
NetbiosDomainName = oArgs(5)

Dim dpmProductCode, installstate, dpmversion, osversion

Const msiInstallStateUnknown = -1
Const msiInstallStateAbsent = 2

Set oDiscData = oAPI.CreateDiscoveryData(SourceType, SourceId, ManagedEntityId)

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
&amp; "{impersonationLevel=impersonate}!\\" &amp; strComputer &amp; "\root\cimv2")

Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems
'MsgBox("OS INFO:" &amp; objOperatingSystem.Caption &amp; " " &amp; objOperatingSystem.Version)
osversion = objOperatingSystem.Caption &amp; " " &amp; objOperatingSystem.Version
Next

Set objProcessor = objWMIService.Get("win32_Processor='CPU0'")


dpmProductCode = "{D23FF6A2-6685-4595-9066-1D9B425B8A36}"

installstate = MsiQueryProductState(dpmProductCode)

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"]$")

call oInst.AddProperty("$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$", TargetComputer)
call oInst.AddProperty("$MPElement[Name="Microsoft.Windows.SystemCenterDPM2010.DPMServer"]/WindowsVersion$", osversion)
call oInst.AddProperty("$MPElement[Name="System!System.Entity"]/DisplayName$",NetbiosComputerName)
call oInst.AddProperty("$MPElement[Name="Microsoft.Windows.SystemCenterDPM2010.DPMServer"]/DomainName$", NetbiosDomainName)

call oDiscData.AddInstance(oInst)
End if

call oAPI.Return(oDiscData)



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>