Discovery Class to discover all instances of the AppSense MC 8.x installed on Windows computers within the scope of the System Center Operations Manager 2007 Management Group.
AppSense MC 8 Discovery
Discovery Class to discover all instances of the AppSense MC 8.x installed on Windows computers within the scope of the System Center Operations Manager 2007 Management Group.
Target | Microsoft.Windows.Computer |
Enabled | True |
Frequency | 86400 |
Remotable | False |
Discovered Classes and their attribuets: |
---|
ID | Module Type | TypeId | RunAs |
---|---|---|---|
DS | DataSource | Microsoft.Windows.TimedScript.DiscoveryProvider | Default |
<Discovery ID="AppSense.AMC.8.AMC.Server.Discovery" Enabled="true" Target="Windows!Microsoft.Windows.Computer" ConfirmDelivery="true" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="AppSense.AMC.8.AMC.Server"/>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
<IntervalSeconds>86400</IntervalSeconds>
<SyncTime/>
<ScriptName>AMC.ServerService.vbs</ScriptName>
<Arguments>$MPElement$ $Target/Id$ $Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Arguments>
<ScriptBody> const HKEY_LOCAL_MACHINE = &H80000002
SetLocale("en-us")
Dim oArgs
Set oArgs = WScript.Arguments
Dim SourceId, ManagedEntityId, targetComputer
' SourceId is the GUID of the discovery object that runs the script.
SourceId = oArgs(0)
' ManagedEntityId is the GUID of the computer class that is targeted by the script.
ManagedEntityId = oArgs(1)
' targetComputer is the Fully Qualified Domain Name
' of the computer targeted by the script. The FQDN
' is in Arg(2) of the command prompt.
targetComputer = oArgs(2)
Dim oAPI
Set oApi = CreateObject("MOM.ScriptAPI")
Dim oDiscoveryData
set oDiscoveryData = oAPI.CreateDiscoveryData(0, SourceId, ManagedEntityId)
set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & targetComputer & "\root\cimv2")
set items = objWMIService.ExecQuery("select Name, Version from win32_product where NAME like 'AppSense Management Server% 8%'")
If IsNull(items) = false And items.Count > 0 Then
' Create the application instance.
Set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='AppSense.AMC.8.AMC.Server']$")
For Each item in items
' Define the property values.
Call oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", targetComputer)
Call oInst.AddProperty("$MPElement[Name='AppSense.AMC.8.AMC.Server']/ProductName$", item.Name)
Call oInst.AddProperty("$MPElement[Name='AppSense.AMC.8.AMC.Server']/ProductVersion$", item.Version)
Next
oDiscoveryData.AddInstance(oInst)
End If
' Submit the discovery data to the Operations Manager database.
oAPI.Return(oDiscoveryData) </ScriptBody>
<TimeoutSeconds>301</TimeoutSeconds>
</DataSource>
</Discovery>