' Create a Discovery Data Record
Const ADDPPROP_NONE = &H0
Const ADDPROP_GUID = &H2
Const ADDPROP_KEY = &H8
Const ADDPROP_ARRAY = &H10
Dim DDR
Dim Computer
Dim SiteName
Dim FSO
Dim IPAddress(3), IPSubnet(3), MACAddress(3)
Computer="ComputerName"
SiteName="Acive Directory Site Name"
Set DDR=CreateObject("SMSResGen.SMSResGen.1")
DDR.DDRNew "System", "CustomAgent", "NES"
DDR.DDRAddString "Netbios Name", Computer, 64, ADDPROP_KEY
DDR.DDRAddString "AD Site Name", SiteName, 64, ADDPPROP_NONE
IPAddress(0)="123.234.12.23"
IPAddress(1)="123.234.12.32"
IPSubnet(0)="123.234.12.0"
IPSubnet(1)="123.234.12.0"
MACAddress(0)="00:02:A5:B1:11:68"
MACAddress(1)="00:02:A5:B1:11:69"
DDR.DDRAddStringArray "IP Addresses", Array(IPAddress(0),IPAddress(1)), 64, ADDPROP_ARRAY
DDR.DDRAddStringArray "MAC Addresses", Array(MACAddress(0),MACAddress(1)), 64, _
ADDPROP_ARRAY OR ADDPROP_KEY
DDR.DDRAddStringArray "IP Subnets", Array(IPSubnet(0),IPSubnet(1)), 64, ADDPROP_ARRAY
DDR.DDRWrite "MyDDR.DDR"
DDR.DDRSendtoSMS
Set FSO=CreateObject("Scripting.FileSystemObject")
FSO.GetFile("MyDDR.DDR").Delete