Skip to content

Query and Move computer into specific Collection

Featured Replies

First off, let me say that this forum has been a massive help to myself when setting up and deploying SCCM 2012 R2 in my current work environment. I would be at loss if i were to read Technet all day.

 

I need a bit of help in terms of Collections and scripting.

 

I have a script working in my task sequence which moves the computer into a specific collection in order to receive updates straight after imaging has been completed (using the following script https://blogs.msdn.microsoft.com/vinpa/2010/09/01/how-to-add-a-knownunknown-computer-to-a-specified-collection-during-os-deployment/),however within that second task sequence, i would like to incorporate another script which will then move that computer object from the current collection into 1 of 'n' collections based on part of their computer name.. for example, 'if the computer name starts off with "NYxxxxx", move the computer into the NY Office collection.

 

I could however use my current working script and created several 'Run Command Line' tasks pointing to different collection ID, but i think that would be very inefficient and want to know if there was a better way.. perhaps nested variables etc

 

 

Any help would be much appreciated

Edited by im4gine3

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.