Jeroen van Geem Posted February 10, 2015 Report post Posted February 10, 2015 Hi all, I am trying to achieve the following during my OS deployment; Add the device into a collection followed by running some patching cycles. However I cant seem to figure out how to add the device into a patching collection. I found a vb script out 2010 online (attached) which I used, but no luck. This is the line: cscript c:\Installs\Tools\AddMeToCollection.vbs xxxxxx "GLB - Patch Sunday 05:00 - Reboot" %_SMSTSClientIdentity% Are there any new ways to make this possible? Once it is in the collection I was planning on running the following twice: Run script: WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000113}" /NOINTERACTIVE Run script:powershell.exe -command start-sleep 30 Install Software Updates (built-in task) But without the system being in a collection it wont do anything. Any ideas? Thanks! 2134.AddMeToCollection.txt Quote Share this post Link to post Share on other sites More sharing options...
Jorgen Nilsson Posted February 10, 2015 Report post Posted February 10, 2015 Hi, I use that script as well, but you should the CollectionID and not the collectionname in the command line, cscript AddMeToCollection.vbs <SiteServerName> <CollectionID> %_SMSTSClientIdentity% also make sure either the Network access account or if you run it as a "Run command line step using another user account" that the accounts used have the correct permissions as well. But changing the command line shoudl solve it. Regards,Jörgen Quote Share this post Link to post Share on other sites More sharing options...
Jeroen van Geem Posted February 11, 2015 Report post Posted February 11, 2015 Thanks, will give that one a go. During deployment, after the SCCM client gets installed this script will run maybe one minute after that. Does this give the SCCM server enough time to have the server currently being deployed to be added in its repository? I do know it takes time before a new deployed system shows in the gui. Quote Share this post Link to post Share on other sites More sharing options...
Dean Posted February 11, 2015 Report post Posted February 11, 2015 I think I am using the same script, but instead of using the collection "title" use the collection ID (SMS0001 etc) seems to work.! but I do not try to run updates immediately, I have a Update group targeted at the unknowns, but if you have specifics... I basically assign to a maintenance window and wait to the cycle to pick up anything missing. We update the deployments quarterly, so there are generally only a few missing. I would enable incremental updates on the collections that you are hitting, so they see things "quickly" Quote Share this post Link to post Share on other sites More sharing options...
Jeroen van Geem Posted February 12, 2015 Report post Posted February 12, 2015 Hmmm, it doesnt seem to find the resourceID eventhough the %_SMSTSClientIdentity% gets resolved correctly. Quote Share this post Link to post Share on other sites More sharing options...
Jeroen van Geem Posted February 19, 2015 Report post Posted February 19, 2015 Anyone? Quote Share this post Link to post Share on other sites More sharing options...
Jeroen van Geem Posted February 20, 2015 Report post Posted February 20, 2015 Fixed by running the task under a domain account with SCCM access instead of the built-in system account. Quote Share this post Link to post Share on other sites More sharing options...