How to Create DDRs for an SMS Client

Published : April 11, 2005

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:

  • Use the Regsvr32 command to register the Resource Generator object on any computer that you wish to run SMS Resource Generator object scripts.

  • The SMS Resource Generator object does not have to be run on the clients that are to be discovered. The DDRs can be created on any SMS computer.

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

On This Page

Example
Compiling the Code
See Also

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