Dim oAPI, oDiscoveryData, oInst
Set oAPI = CreateObject("MOM.ScriptAPI")
set oDiscoveryData = oAPI.CreateDiscoveryData(0, sourceId, managedEntityId)
set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Dell.WindowsServer.Sink']$")
call oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", targetComputer)
call oInst.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", "Dell Windows Server")
call oInst.AddProperty("$MPElement[Name='Dell.WindowsServer.Sink']/Name$", targetComputer)
call oDiscoveryData.AddInstance(oInst)
Call oAPI.Return(oDiscoveryData)
Set oAPI = Nothing
Err.Clear
Function readRegistry(ByVal regKey)
on error resume next
dim bKey, oShell, isPresent
bKey = false
Set oShell = CreateObject ("WScript.Shell")
bKey = oShell.RegRead(regKey)
if(bKey="") Then
readRegistry = true
else
readRegistry = false
end if
'wscript.echo "readRegistry is " & readRegistry
Err.Clear
End Function
Function writeRegistry(ByVal regKey, ByVal val)
on error resume next
Dim oShell
Set oShell = CreateObject ("WScript.Shell")
oShell.RegWrite regKey, val
Err.Clear
End Function </Script></ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
</DataSource>
</MemberModules>
<Composition>
<Node ID="DS"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.Discovery.Data</OutputType>
</DataSourceModuleType>