ConfigMgr : Create New computer programattically for OS deployment

%3CLINGO-SUB%20id%3D%22lingo-sub-792451%22%20slang%3D%22en-US%22%3EConfigMgr%20%3A%20Create%20New%20computer%20programattically%20for%20OS%20deployment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-792451%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20using%20below%20code%20to%26nbsp%3Bcreate%20a%20%3CSTRONG%3Enew%20computer%3C%2FSTRONG%3Ein%20SCCM.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000080%22%3EDim%20connection%20As%20WqlConnectionManager%20%3D%20Connect(siteServer)%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000080%22%3Econnection.ExecuteMethod(%22SMS_Site%22%2C%20%22ImportMachineEntry%22%2C%20inParams)%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFurther%20to%20this%2C%20looking%20to%20process%20the%20request%20for%20OS%20deployment%20too.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20I%20need%20to%20add%20the%20%3CSPAN%3Edata%20discovery%20record%20(DDR)%20as%20well%20to%20SCCM%20site%2C%20to%20process%20the%20deployment%20instantly%3F%26nbsp%3B%3C%2FSPAN%3EOr%20creating%20new%20computer%20itself%20will%20take%20care%20of%20updating%20DDR%20records%20in%20the%20database%20as%20well.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-792451%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOperating%20System%20Deployment%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-793212%22%20slang%3D%22en-US%22%3ERe%3A%20ConfigMgr%20%3A%20Create%20New%20computer%20programattically%20for%20OS%20deployment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-793212%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F388035%22%20target%3D%22_blank%22%3E%40Pradeep_Bansal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EProcess%20what%20%22request%22%20for%20deployment%3F%3C%2FP%3E%0A%3CP%3EIf%20the%20system%20doesn't%20have%20a%20client%20agent%2C%20there's%20no%20way%20to%20force%20the%20system%20to%20do%20anything%20automatically.%20Creating%20a%20resource%20enables%20known%20computer%20support%20for%20OSD%20when%20you%20manually%20PXE%20boot%20or%20boot%20a%20system%20from%20boot%20media.%20You%20can't%20%5Bmagically%5D%20force%20an%20unmanaged%20system%20to%20do%20something.%3C%2FP%3E%0A%3CP%3EThe%20%3CSPAN%3EImportMachineEntry%26nbsp%3B%3C%2FSPAN%3Emethod%20already%20creates%2Fuses%20a%20DDR%20as%20that's%20the%20only%20%5Bsupported%5D%20way%20to%20create%20a%20resource%20in%20ConfigMgr.%20As%20noted%2C%20this%20doesn't%20make%20the%20target%20system%20%22managed%22%20though.%20It%20simply%20makes%20it%20%22known%22%20to%20the%20site%20by%20MAC%20Address%20and%2For%20SMBIOS%20GUID%20which%20enables%20booting%20to%20WinPE%20using%20PXE%20or%20boot%20media%20as%20noted.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Visitor

I am using below code to create a new computer in SCCM.

 

Dim connection As WqlConnectionManager = Connect(siteServer)

connection.ExecuteMethod("SMS_Site", "ImportMachineEntry", inParams)

 

Further to this, looking to process the request for OS deployment too.

 

Do I need to add the data discovery record (DDR) as well to SCCM site, to process the deployment instantly? Or creating new computer itself will take care of updating DDR records in the database as well.

 

1 Reply
Highlighted

@Pradeep_Bansal 

Process what "request" for deployment?

If the system doesn't have a client agent, there's no way to force the system to do anything automatically. Creating a resource enables known computer support for OSD when you manually PXE boot or boot a system from boot media. You can't [magically] force an unmanaged system to do something.

The ImportMachineEntry method already creates/uses a DDR as that's the only [supported] way to create a resource in ConfigMgr. As noted, this doesn't make the target system "managed" though. It simply makes it "known" to the site by MAC Address and/or SMBIOS GUID which enables booting to WinPE using PXE or boot media as noted.