Creating discovery data records (DDRs) for clients allows you to discover clients from any source that you might have available. When the clients are discovered, their installation can be forced with Client Push Installation.

To create a completely accurate DDR for the computer on which the script is run, additions would have to be made to collect TCP/IP addresses, subnets, and media access control (MAC) addresses.

The following script shows how to create a DDR using the SMS Resource Generator object SMSRsGenCtl. When using the SMS Resource Generator object, remember the following:

For more information about using DDRs in resource discovery, see the SMS 2003 SDK.

For more information on DDR properties, see the topic the DDR Properties in the SMS 2003 SDK

Example

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

Compiling the Code

  • Requires an SMS 2003 Client

  • Requires SMSRsGenCtl.dll—Available from the SMS 2003 SDK.

See Also

Other Resources

Discovering Resources