Over the years, in many SCCM consulting projects that we got involved in, we get the same question: “Can you create SCCM collections for Servers, Laptops, Workstations, Windows 10…”. Back in 2015, I started to build an SCCM collection PowerShell script to create these operational collections that I create right after we do an SCCM installation. With time, I added more and more collections to the script. Today, the script contains more than 130 collections and has been downloaded more than 60 000 times making this my most downloaded contribution to the community.
This set of collections usually covers 95% of the initial client needs. All you need to do is to run the SCCM collection PowerShell script on your SCCM server and wait. After running, you’ll end up having 134 collections in an Operational folder.
The collections are set to refresh on a 7 days schedule. Once created, you can use these collections to have a quick overview of your devices. You can also use this collection to create deployment collections by using limiting collections on these ones.
The script uses the New-CMDeviceCollection and Add-CMDeviceCollectionQueryMembershipRule cmdlet.
Over the years, in many SCCM consulting projects that we got involved in, we get the same question: “Can you create SCCM collections for Servers, Laptops, Workstations, Windows 10…”. Back in 2015, I started to build an SCCM collection PowerShell script to create these operational collections that I create right after we do an SCCM installation. With time, I added more and more collections to the script. Today, the script contains more than 130 collections and has been downloaded more than 60 000 times making this my most downloaded contribution to the community.
This set of collections usually covers 95% of the initial client needs. All you need to do is to run the SCCM collection PowerShell script on your SCCM server and wait. After running, you’ll end up having 134 collections in an Operational folder.
The collections are set to refresh on a 7 days schedule. Once created, you can use these collections to have a quick overview of your devices. You can also use this collection to create deployment collections by using limiting collections on these ones.
The script uses the New-CMDeviceCollection and Add-CMDeviceCollectionQueryMembershipRule cmdlet.




FULL COLLECTIONS LIST
Here’s the full SCCM collection that the script Powershell will create.
All Clients
All Clients Active
All Client Inactive
All Clients Online
All Clients R2 CU0
All Clients R2 CU1
All Clients R2 CU2
All Clients R2 CU3
All Clients R2 CU4
All Clients R2 CU5
All Clients R2 SP1
All Clients R2 SP1 CU1
All Clients R2 SP1 CU2
All Clients R2 CU0
All Clients R2 CU1
All Clients R2 CU2
All Clients R2 CU3
All Clients R2 CU4
All Clients R2 CU5
All Clients R2 SP1
All Clients R2 SP1 CU1
All Clients R2 SP1 CU2
All Clients R2 SP1 CU3
All Clients Not Latest
All Client 1511
All Client 1602
All Client 1606
All Client 1610
All Client 1702
All Client 1706
All Client 1710
All Client 1802
All Client 1806
All Client 1810
All Client 1902
All Client 1906
All Client 1910
All Client 2002
All Client 2006
All Client 2010
All Client 2103
All Client 2107
All Clients Not Reporting HW Inv since 14 days
All Clients Not Reporting SW Inv since 30 days
All Clients X86
All Clients X64
All Laptops
All HP Laptops
All Lenovo Laptops
All Dell Laptops
All SCCM Distribution Points
All SCCM Site Servers
All SCCM Site Systems
All Servers
All Servers Physical
All Servers Virtual
All Servers Windows 2003 or 2003 R2
All Servers Windows 2008 or 2008 R2
All Servers Windows 2012 or 2012 R2
All Servers Windows 2016
All Servers Windows 2019
All Systems Created Since 24h
All Systems Disabled
All Systems Non Client
All Systems Obsolete
All Systems with SCCM Console
All Workstations
All Workstations Windows 7
All Workstations Windows 8
All Workstations Windows 8.1
All Workstations Windows 10
All Workstations Windows 11
All Workstations Windows XP
All Windows Update Agent Version Outdated
Mobile Devices – All Android
Mobile Devices – All Ipad
Mobile Devices – All Iphone
Mobile Devices – All Windows Phone 10
Mobile Devices – All Windows Phone 8
Mobile Devices – All Windows Phone 8.1
Mobile Devices – All Microsoft Surface
Mobile Devices – All Microsoft Surface 3
Mobile Devices – All Microsoft Surface 4
Mobile Device – All
Workstations | Windows 10 v1507
Workstations | Windows 10 v1511
Workstations | Windows 10 v1607
Workstations | Windows 10 v1703
Workstations | Windows 10 v1709
Workstations | Windows 10 v1803
Workstations | Windows 10 v1809
Workstations | Windows 10 v1903
Workstations | Windows 10 v1909
Workstations | Windows 10 Current Branch (CB)
Workstations | Windows 10 Current Branch for Business (CBB)
Workstations | Windows 10 Long Term Servicing Branch (LTSB)
Workstations | Windows 10 Support State – Current
Workstations | Windows 10 Support State – Expired Soon
Workstations | Windows 10 Support State – Expired
Others | Linux Devices
Others | MAC OSX Devices
Office 365 Build Version | 1705
Office 365 Build Version | 1709
Office 365 Build Version | 1802
Office 365 Build Version | 1803
Office 365 Build Version | 1808
Office 365 Build Version | 1902
Office 365 Build Version | 1908
Office 365 Build Version | 1912
Office 365 Build Version | 2001
Office 365 Build Version | 2002
Office 365 Build Version | 2003
Office 365 Build Version | 2004
Office 365 Build Version | 2005
Office 365 Build Version | 2006
Office 365 Build Version | 2007
Office 365 Build Version | 2008
Office 365 Build Version | 2009
Office 365 Build Version | 2010
Office 365 Build Version | 2011
Office 365 Build Version | 2012
Office 365 Build Version | 2101
Office 365 Build Version | 2102
Office 365 Build Version | 2103
Office 365 Build Version | 2104
Office 365 Build Version | 2105
Office 365 Build Version | 2106
Office 365 Build Version | 2107
Office 365 Build Version | 2108
Office 365 Build Version | 2109
Office 365 Build Version | 2110
Office 365 Channel | Monthly
Office 365 Channel | Monthly (Targeted)
Office 365 Channel | Semi-Annual
Office 365 Channel | Semi-Annual (Targeted)
All systems having a duplicate device record
SCCM COLLECTION POWERSHELL SCRIPT NOTE
The script will detect if the collection has already been created. It will give a warning and create only new collections that have been added since the last time the script is run.
If you are comfortable with editing scripts, you can comment out any unwanted collections using (#) at each line of the section.
Ex:
#$Collections +=
#$DummyObject |
#Select-Object @{L=”Name”
#; E={“Clients Version | R2 CU5″}},@{L=”Query”
#; E={“select #SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifie#r,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System
#where SMS_R_System.ClientVersion = ‘5.00.7958.1604’”}},@{L=”LimitingCollection”
#; E={$LimitingCollection}},@{L=”Comment”
#; E={“All systems with SCCM client version R2 CU5 installed”}}
#New-CMDeviceCollection -Name $Collection1.Name -LimitingCollectionName $LimitingCollection -RefreshSchedule $Schedule -RefreshType 2
#Add-CMDeviceCollectionQueryMembershipRule -CollectionName $Collection1.Name -QueryExpression $Collection1.Query -RuleName $Collection1.Name
DOWNLOAD THE SCCM COLLECTION POWERSHELL SCRIPT
The script can be downloaded from my GitHub repo.
Extra hint: You can also verify if your collection has been created properly in your collections with our Configuration Manager – Collections report. Simply sort the report by the Operational folder name

Read the full article here:https://systemcenterdudes.com/create-operational-sccm-collection-using-powershell-script/