Service Manager Management Server Discovery

Microsoft.SystemCenter.ServiceManager.SmManagementServer.Discovery (Discovery)

Discovers Microsoft System Center Service Manager Servers.

Knowledge Base article:

Summary

Disabling this discovery will prevent Service Manager from being discovered.Discovery runs once every day, however it can be changed by overriding the frequency.

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.SystemCenter.ServiceManager.SmManagementServer.Discovery" Enabled="true" Target="Windows!Microsoft.Windows.Server.Computer" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="SM!Microsoft.SystemCenter.ServiceManager.SmManagementServer"/>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
<IntervalSeconds>86400</IntervalSeconds>
<SyncTime/>
<ScriptName>SmManagementServerDiscovery.vbs</ScriptName>
<Arguments>$MPElement$ $Target/Id$ $Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$ $Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</Arguments>
<ScriptBody><Script>
'*************************************************************************
' ScriptName: SmManagementServerDiscovery.vbs
'
' Purpose - Populate properties of SM Management Server
'
' Parameters - 0 - discovery id
' 1 - Target managed entity id
' 2 - Host Computer Principal Name
' 3 - Network Name
'*************************************************************************
Option Explicit
SetLocale("en-us")
On Error Resume Next

Dim oAPI, sourceId, managedEntityId, principalName, networkName

Set oAPI = CreateObject("MOM.ScriptAPI")
sourceId = WScript.Arguments(0)
managedEntityId = WScript.Arguments(1)
principalName = WScript.Arguments(2)
networkName = WScript.Arguments(3)

Call oAPI.LogScriptEvent("SmManagementServerDiscovery.vbs", 3000, 4, "Starting discovery of Service Manager Management Server.")

Dim oReg, arrSubKeys, sdkServiceType, iResult, oDiscoveryData, oInst, currentVersion
Set oDiscoveryData = oAPI.CreateDiscoveryData(0, sourceId, managedEntityId)
Set oReg = GetObject("winmgmts:\\" &amp; principalName &amp; "\root\default:StdRegProv")
If Err &lt;&gt; 0 Then
Call oAPI.LogScriptEvent("SmManagementServerDiscovery.vbs", 3000, 4, "Unable to bind to WMI registry provider on " &amp; principalName &amp; ". Terminating Discovery.")
Call oAPI.Return(oDiscoveryData)
WScript.Quit
End if
Const HKEY_LOCAL_MACHINE = &amp;H80000002


'Begin SCSM 2010 Discovery
iResult = oReg.Enumkey(HKEY_LOCAL_Machine, "SOFTWARE\Microsoft\System Center\2010\Service Manager\Setup", arrSubKeys)
If iResult = 0 then
iResult = oReg.Enumkey(HKEY_LOCAL_Machine, "SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Server Management Groups", arrSubKeys)
If iResult = 0 then
iResult = oReg.GetDWORDValue(HKEY_LOCAL_Machine, "SOFTWARE\Microsoft\System Center\2010\Common\SDK Service", "SDK Service Type", sdkServiceType)
If iResult = 0 then
If sdkServiceType = 1 then
iResult = oReg.GetStringValue(HKEY_LOCAL_Machine, "SOFTWARE\Microsoft\System Center\2010\Service Manager\Setup", "CurrentVersion", currentVersion)
If iResult = 0 then
'Determine SM Version
Dim iMajorProductVersion, iMinorProductVersion, iFirstPeriod, iSecondPeriod, Version
iFirstPeriod = InStr(currentVersion, ".")
iSecondPeriod = InStr(iFirstPeriod+1, currentVersion,".")
iMajorProductVersion = Left(currentVersion, iFirstPeriod-1)
iMinorProductVersion = Mid(currentVersion, iFirstPeriod+1, iSecondPeriod-iFirstPeriod-1)
If iMajorProductVersion = 7 and iMinorProductVersion = 0 then
Version = "2010"
Set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='SM!Microsoft.SystemCenter.ServiceManager.SmManagementServer.2010']$")
ElseIf iMajorProductVersion = 7 and iMinorProductVersion = 5 then
Version = "2012"
Set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='SM!Microsoft.SystemCenter.ServiceManager.SmManagementServer.2012']$")
Else
Call oAPI.LogScriptEvent("SmManagementServerDiscovery.vbs", 3000, 4, "Did not recognise Service Manager Version, terminating discovery.")
Call oAPI.Return(oDiscoveryData)
WScript.Quit
End If
Call oAPI.LogScriptEvent("SmManagementServerDiscovery.vbs", 3000, 4, "Discovered SCSM "&amp; Version &amp;" Management Server.")
Call oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", principalName)
Call oInst.AddProperty("$MPElement[Name='SM!Microsoft.SystemCenter.ServiceManager.SmManagementServer']/ServerName$", networkName)
Call oInst.AddProperty("$MPElement[Name='SM!Microsoft.SystemCenter.ServiceManager.ManagementServer']/Version$", Version)
Call oInst.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", principalName)
Call oDiscoveryData.AddInstance(oInst)
End If
End If
End If
End If
End If

Call oAPI.Return(oDiscoveryData)
Call oAPI.LogScriptEvent("SmManagementServerDiscovery.vbs", 3000, 4, "Ending discovery of Service Manager Management Server.")
WScript.Quit
</Script></ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
</DataSource>
</Discovery>