Create ConfigMgr 2012 R2 Collections with Powershell

I know we have migrations tools and other built-in options when we want to build a new ConfigMgr environment. But Microsoft have given us Powershell, and there are some really cool cmdlets that we can utilize.

I’ve had a couple of examples lately where i had to create 100+ collections from scratch – or basicly from just a list of applications… And instead of doing that by hand i would much rather do it with Powershell, and save my poor fingers alot of clicking and typing.

Microsoft have a Technet site where all ConfigMgr 2012 R2 cmdlets are listed and described –

Based on all the info from that Microsoft website i did the following:

1 – Collections need Update Schedules, so i went ahead and defined them to begin with.

2 – Defined my Device Collections to be created.

3 – Defined a Query Rule for my Device Collections.

4 – Defined my User Collections to be created.

5 – Defined a Query Rule for my User Collections.

Note: If you want incremental updating enabled on the Collections you can set the –RefreshType to Both instead of Periodic

Now there might be some Powershell guru out there saying – pfft i can do that much better by creating some automation and check’s and UI maybe even. But for normal beings like me this might be helpfull to a some.

So feel free to grab the code and save some time.

– ConfigMgr is my high!

Get the Powershell file from my Skydrive:

By | 2014-02-18T14:07:36+00:00 February 18th, 2014|Configuration Manager (SCCM), Powershell|4 Comments

About the Author:

Henrik Hoe
ConfigMgr specialist that started many years ago with SMS 2003 and been with the product/concept ever since. (Fanatical some would say - i can only agree) Experienced with large customer environments and architecture.MCPMCTS: ConfigMgr 2012MCSA: Windows Server 2012MCT


  1. Chris September 17, 2015 at 0:40 - Reply

    Thanks a lot!

  2. Tomas November 2, 2015 at 15:14 - Reply

    thx Henrik, nice & easy 🙂

  3. Chris D February 6, 2018 at 17:21 - Reply

    Thanks Henrik, there are a lot of normal beings out there 🙂

  4. Manikanta March 17, 2018 at 19:04 - Reply

    Very good to know,
    Could you please let us know how to create a UI tool for the same to create a collection and deployments etc.
    Also any powershell guide to learn from scratch to high with respect to sccm etc

Leave A Comment