I would like to automatically add an Unknown PC to a specific collection during a task sequence. I came across a VBScript that does this on the following site:
http://blogs.msdn.com/b/vinpa/archive/2010/09/01/how-to-add-a-known-unknown-computer-to-a-specified-collection-during-os-deployment.aspx
According to the explanation you run the script as a 'Run Command Line' task in the Task Sequence specifying the following Command line:
cscript AddMeToCollection.vbs sccmservername collectionID %_SMSTSClientIdentity%
I run this script with an account that has full admin rights on the SCCM Server. It is my understanding that you can not use a command line step that uses a specific account during the Windows PE phase, therefore I run this task after a reboot that restarts the PC with the installed Operating System. This task is run after the Setup Windows and ConfigMgr step.
Although the task completes successfully with a 0 exit code, the PC does not get added to the specified collection. Looking at the logs the output of the script is as below:
===================================
ADDING COMPUTER TO COLLECTION
===================================
Site Server specified: mysccmserver
Collection ID specified: SMSxxxxxx
SMS Client GUID:xxxxx
Computer Name: myPC
SMS Provider Namespace = \\mysccmserver\root\sms\site_XXX
Successfully Connected to the SMS Provider Namespace.
Looking at the script it seems if the script were to execute successfully some further messages would be output:
WScript.Echo "Resource ID = " & strResourceID
WScript.Echo strComputerName & " successfully added To " & strCollID
Has anyone successfully used this script or a similar script to add a PC to a specific collection during the Task Sequence? Any advice as to where I may be going wrong would be greatly appreciated. I am using SCCM 2007 R3 and deploying Windows 7 Enterprise 64 Bit.
It is not recommended that you use domain admin to run the command. You can use a regular domain account. Notice that you need to allow the account to manage the SMS provider in site database.
1.From the Start menu, click Run and type Dcomcnfg.exe.
2.In Component Services, click Console root, expand Component Services, expand Computers, and then click My Computer. On the Action menu, click Properties.
3.In the My Computer Properties dialog box, on the COM Security tab, in the Launch and Activation Permissions section, click Edit Limits.
4.In the Launch Permissions dialog box, click Add.
5.In the Select User, Computers, or Groups dialog box, in the Enter the object names to select (examples): box, type SMS Admins and click OK.
6.In the Permissions for SMS Admins section, select the check box to allow Remote Activation.
7.Click OK twice, and then close Computer Management.
Arthur-Thanks for the input. I checked your suggestion and the account I am using already had those permissions assigned in Dcomcnfg. The script still fails saying it could not find the resource id for the computer.
Anyway I managed to find a work around, but once again thanks for the suggestion.
What was the work around that you found? I am wanting to do this same thing in SCCM 2012.
I tried the same script and also placed it in various positions thru out the task sequence and had no luck either.
Thanks