Quantcast
Channel: Configuration Manager 2007 Operating System Deployment forum
Viewing all articles
Browse latest Browse all 1063

Add PC to Collection During Task Sequence

$
0
0

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.

Viewing all articles
Browse latest Browse all 1063

Trending Articles