MOSS 2007 Server Script Discovery

Microsoft.Office.Sharepoint.Server.2007.MOSS.Server.Discovery (Discovery)

This Discovery discovers the objects of the Office Sharepoint Server 2007 Server.

Knowledge Base article:

Summary

This Discovery discovers the objects of the Office Sharepoint Server 2007 Server.

© 2000-2007 Microsoft Corporation, all rights reserved.

Element properties:

TargetMicrosoft.Windows.Computer
EnabledTrue
Frequency3600
RemotableFalse

Object Discovery Details:

Discovered Classes and their attribuets:

Member Modules:

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

Source Code:

<Discovery ID="Microsoft.Office.Sharepoint.Server.2007.MOSS.Server.Discovery" Enabled="true" Target="MSWL!Microsoft.Windows.Computer" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="Microsoft.Office.Sharepoint.Server.2007.MOSS.Server">
<Property PropertyID="Server_Name"/>
</DiscoveryClass>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="MSWL!Microsoft.Windows.TimedScript.DiscoveryProvider" RunAs="System!System.PrivilegedMonitoringAccount">
<IntervalSeconds>3600</IntervalSeconds>
<SyncTime/>
<ScriptName>GetServerNames.vbs</ScriptName>
<Arguments>$MPElement$ $Target/Id$ $Target/Property[Type="MSWL!Microsoft.Windows.Computer"]/PrincipalName$</Arguments>
<ScriptBody><Script>
'Copyright (c) Microsoft Corporation. All rights reserved.
Option Explicit
SetLocale("en-us")

Dim oArgs
Set oArgs = WScript.Arguments
if oArgs.Count &lt; 3 Then
Wscript.Quit -1
End If
Dim SourceID, ManagedEntityId, TargetComputerIdentityID
SourceId = oArgs(0)
ManagedEntityId = oArgs(1)
TargetComputerIdentityID = oArgs(2)
Dim oAPI, oDiscoveryData, oInst
Set oAPI = CreateObject("MOM.ScriptAPI")
set oDiscoveryData = oAPI.CreateDiscoveryData(0, SourceId, ManagedEntityId)
Dim oRegistry, strServerRole, strMOSSServer
Set oRegistry = CreateObject("WScript.Shell")
On Error Resume Next
strServerRole = oRegistry.RegRead("HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\WSS\ServerRole")
If (Err.Number &lt;&gt; 0) Then
Err.Clear
Call oAPI.Return(oDiscoveryData)
Wscript.Quit
End If
If (strServerRole = "SINGLESERVER" or strServerRole = "APPLICATION" or strServerRole = "WFE")Then
On Error Resume Next
strMOSSServer = oRegistry.RegRead("HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\WSS\Services\Microsoft.Office.Server.Conversions.LauncherService\ServiceName")
If (Err.Number &lt;&gt; 0) Then
If Hex(Err.number) = "80070002" Then
call oAPI.LogScriptEvent("GetServerNames.vbs",363, 1, "Script Data Error: " &amp; Err.Description)
End If
Err.Clear
Call oAPI.Return(oDiscoveryData)
Wscript.Quit
End If
If strMOSSServer = "DCLauncher" Then
' Create the Application instance
set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Office.Sharepoint.Server.2007.MOSS.Server']$")
call oInst.AddProperty("$MPElement[Name='MSWL!Microsoft.Windows.Computer']/PrincipalName$", TargetComputerIdentityID)
call oInst.AddProperty("$MPElement[Name='Microsoft.Office.Sharepoint.Server.2007.MOSS.Server']/Server_Name$", "$Target/Property[Type='MSWL!Microsoft.Windows.Computer']/NetbiosComputerName$")
call oDiscoveryData.AddInstance(oInst)
End If
End If
' Submit the data
Call oAPI.Return(oDiscoveryData) </Script></ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
</DataSource>
</Discovery>