Skip to content

During deployment, add the collection and run patching cycles?

Featured Replies

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

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

  • Author

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.

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"

  • Author

Hmmm, it doesnt seem to find the resourceID eventhough the %_SMSTSClientIdentity% gets resolved correctly.

 

 

dm5el4.png

 

5nndxx.png

  • Author

Fixed by running the task under a domain account with SCCM access instead of the built-in system account. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.