Dim oData, oClass
Set oData = oAPI.CreateDiscoveryData(0, sourceId, managedEntityId)
Dim oFaxServer, colDevices
Set oFaxServer = CreateObject("FaxComEx.FaxServer")
if IsNull(oFaxServer) = false then
oFaxServer.Connect displayName
Set colDevices = oFaxServer.GetDevices()
if IsNull(colDevices) = false then
For Each oFaxDevice in colDevices
Set oClass = oData.CreateClassInstance("$MPElement[Name='Microsoft.Windows.Server.2008.FaxServer.FaxDevice']$")
call oClass.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", oFaxDevice.DeviceName)
call oClass.AddProperty("$MPElement[Name='Microsoft.Windows.Server.2008.FaxServer.FaxDevice']/ID$", oFaxDevice.ID)
call oClass.AddProperty("$MPElement[Name='Microsoft.Windows.Server.2008.FaxServer.FaxDevice']/CSID$", oFaxDevice.CSID)
call oClass.AddProperty("$MPElement[Name='Microsoft.Windows.Server.2008.FaxServer.FaxDevice']/Description$", oFaxDevice.Description)
call oClass.AddProperty("$MPElement[Name='Microsoft.Windows.Server.2008.FaxServer.FaxDevice']/DeviceName$", oFaxDevice.DeviceName)
call oClass.AddProperty("$MPElement[Name='Microsoft.Windows.Server.2008.FaxServer.FaxDevice']/PoweredOff$", oFaxDevice.PoweredOff)
call oClass.AddProperty("$MPElement[Name='Microsoft.Windows.Server.2008.FaxServer.FaxDevice']/ProviderUniqueName$", oFaxDevice.ProviderUniqueName)
call oClass.AddProperty("$MPElement[Name='Microsoft.Windows.Server.2008.FaxServer.FaxDevice']/ReceiveMode$", oFaxDevice.ReceiveMode)
call oClass.AddProperty("$MPElement[Name='Microsoft.Windows.Server.2008.FaxServer.FaxDevice']/ReceivingNow$", oFaxDevice.ReceivingNow)
call oClass.AddProperty("$MPElement[Name='Microsoft.Windows.Server.2008.FaxServer.FaxDevice']/RingingNow$", oFaxDevice.RingingNow)
call oClass.AddProperty("$MPElement[Name='Microsoft.Windows.Server.2008.FaxServer.FaxDevice']/SendEnabled$", oFaxDevice.SendEnabled)
call oClass.AddProperty("$MPElement[Name='Microsoft.Windows.Server.2008.FaxServer.FaxDevice']/SendingNow$", oFaxDevice.SendingNow)
call oClass.AddProperty("$MPElement[Name='Microsoft.Windows.Server.2008.FaxServer.FaxDevice']/TSID$", oFaxDevice.TSID)
Call oClass.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", serverName) 'Inform SCOM of which object to host fax on
call oData.AddInstance(oClass)
Next
end if
end if