Creating a Computer Association from the OSD Task Sequence
I have a custom script running near the end of the OSD task sequence that creates a computer association in SCCM for a hardware replacement. The script looks up the computer name in SCCM and resolves the name to a resource ID, and the resource ID is used to create the computer association. Sometimes it fails to resolve the new computer name to an ID. Maybe because the All Systems collection hasn't updated it's collection membership yet? When I manually update the All Systems collection membership, I see the new computer there but it shows Client = No. When the task sequence is still running in the Win7 specialized setup phase, is the SCCM client supposed to show Yes? Should I add something to the script so it updates the collection membership so the new computer is in All Systems and can be resovled to a resource ID? Thanks for any ideas.
June 20th, 2011 6:32pm

Or maybe I could query the local client and get the resource ID, and use that to create the computer association? Not sure if that will work if the server still shows Client = No for this new build.
Free Windows Admin Tool Kit Click here and download it now
June 21st, 2011 10:18am

I can't find a way to get the Resource ID from the client, but I can get the GUID from smscfg.ini and then find the resource ID from the GUID: "SELECT ResourceId FROM SMS_R_System WHERE SMSUniqueIdentifier = """ & ClientGUID & """" I'm testing this now. Does anyone know why the new computer still shows as name = Unknown and Client = No in the database, even though the Win7 install step and the "Setup windows and ConfigMgr" step is complete? Does the client wait until the task sequence is finished before it reports discovery data?
June 21st, 2011 12:46pm

This doesn't seem to help, the resource ID lookup fails even if I use the client's GUID. But if I update the All Systems collection membership in the console at just the right time it works. So now I'm testing updating collection SMS00001 from the script. Looks like the WMI method to update the membership is called RequestRefresh (not to be confused with refresh from the console which does not update the collection membership, only the MMC view of the data since the last update).
Free Windows Admin Tool Kit Click here and download it now
June 23rd, 2011 3:24pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics