const HKEY_LOCAL_MACHINE = &H80000002
Dim m_strProduct
Sub Main()
Dim oDiscData
Dim oCollection
Dim oInstance
Dim WshShell
Dim strTempProductPath
Set oDiscData = ScriptContext.CreateDiscoveryData
Set oCollection = oDiscData.CreateCollection
ScriptContext.Echo "[Trace]: Sybari Service Discovery started."
With oCollection
.AddScopeFilter "ComputerName", ScriptContext.TargetComputerIdentity
.ClassID = "Antigen Server"
.AddScopeComponent "Services"
End With
Set oInstance = oCollection.CreateInstance
If AntigenInstalled Then
With oInstance
.AddKeyProperty "Server Name", ScriptContext.TargetNetbiosComputer
.AddComponent "Services"
End With
Else
ScriptContext.Echo "[Trace]: No Sybari products found."
End If
If IsArray(arrSubKeys) Then
For Each product in arrProducts
For Each subkey In arrSubKeys
If subkey = product Then
bFound = true
m_strProduct = product
ScriptContext.Echo "[Trace]: " & product & " found."
End If
Next
Next
Else
ScriptContext.Echo "[Error]: Unable to enumerate HKLM\Software\Sybari Software."
End If
AntigenInstalled = bFound
End Function
Function EnumRegKeys(ByVal strKeyPath)
Dim arrKeys()
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
lResult = objReg.EnumKey(HKEY_LOCAL_MACHINE, strKeyPath, arrKeys)
Set objReg = Nothing
EnumRegKeys = arrKeys
End Function </Script></Body>
<Language>VBScript</Language>
<Name>Antigen Service Discovery</Name>
<Parameters/>
<ManagementPackId>[Microsoft.Antigen.v9,,1.0.0.1]</ManagementPackId>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="RunScriptAction"/>
</Composition>
</Composite>
</ModuleImplementation>
<InputType>SystemLibrary!System.BaseData</InputType>
</WriteActionModuleType>