Option Explicit
On Error Resume Next
SetLocale("en-us")
Dim oArgs
Set oArgs = WScript.Arguments
If oArgs.Count < 3 Then
Wscript.Quit -1
End If
Dim sourceId, managedEntityId, targetComputer, model, varModel, modelNumber
sourceId = oArgs(0)
managedEntityId = oArgs(1)
targetComputer = oArgs(2)
model = "$Target/Host/Property[Type="Dell.WindowsServer.Server"]/Model$"
varModel = (LCase(model))
Set modelNumber = New RegExp
With modelNumber
.Pattern = "[0-9][9][0-9][0-9]"
.IgnoreCase = False
.Global = False
End With
Dim oAPI, oDiscoveryData, oInst
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oDiscoveryData = oAPI.CreateDiscoveryData(0, sourceId, managedEntityId)
'checking if model is 9g platform or not
If modelNumber.Test(model) Then
If (InStr(varModel, "poweredge") OR InStr(varModel, "powervault")) Then
set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Dell.Windows.UnsupportedServer']$")
call oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", targetComputer)
call oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.LogicalDevice']/DeviceID$", targetComputer)
call oInst.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", "Platform Not Supported")
call oInst.AddProperty("$MPElement[Name='Dell.Windows.UnsupportedServer']/Model$", model)
call oDiscoveryData.AddInstance(oInst)
Else
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)
End If
Else
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)
End If
' Submit the data
Call oAPI.Return(oDiscoveryData)
Set oDiscoveryData = Nothing
Set oAPI = Nothing </Script></ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
</DataSource>
</MemberModules>
<Composition>
<Node ID="DS"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.Discovery.Data</OutputType>
</DataSourceModuleType>