Over the years, we developed many Powershell scripts to make the life of an SCCM administrator easier. Automation with SCCM PowerShell scripts significantly reduces the time and resources required to perform routine tasks. Among these scripts, we automate collection creations on many features, collection membership, deployment management, and report management. Each of our SCCM Powershell scripts is built to run in your environment. You just need to download them and run it. This blog post aims to present all our SCCM PowerShell scripts simply for you to see if any scripts may help you. So here are all these scripts with their descriptions.

Set of Operational SCCM Collections

This script will create a set of 148 SCCM collections for your various needs. These collections can be used for operational tasks afterward. This script has been downloaded more than 75 000 times making this PowerShell script my most downloaded contribution to the community.

I’ve written a Blog Post with all the details: 

If you already run an older version of this script, the script will handle already created collections by removing them and recreating them.

SCCM PowerShell script

Features :

  • Handle collections that were created by a previous version of the script
  • The collections will be placed in an “Operational” folder
  • The collections are set to 7 days refresh period

Full list :

  • 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 Client 2111
  • All Client 2203
  • All Client 2207
  • 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 v2004
  • Workstations | Windows 10 v20H2
  • Workstations | Windows 10 v21H1
  • Workstations | Windows 10 v21H2
  • Workstations | Windows 11
  • Workstations | Windows 11 v21H2
  • 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
  • Workstations | Co-Management Enabled
  • Workstations | Defender ATP Onboarded
  • Workstations | Defender ATP Not Onboarded

Tip: You can comment out any collections that you don’t want using (#) at the beginning of the “New/Add-CMCollection” lines in the “Create Collection” Section.

Author: Benoit Lecours | Download this script

SCCM PowerShell scripts – Copy User/Device Collection Membership

This SCCM PowerShell script will copy the SCCM User/Device Collection Membership to another SCCM User/Device.

This can be useful in a PC replacement scenario or when a new employee comes in and needs to be a member of the same collection as another employee (Ex: software installation assignment)

Before running the script, enter the right Server name, site code, and domain name.

The script will prompt for confirmation before adding the Device/User to each collection.

Author: Benoit Lecours | Download this script

Create collections with folder structure

The script creates 17 folders and 36 collections. For more details, see the blog post.

The collections will be placed under the right folder based on the purpose of the collection The collections are set to 7 days refresh period The overall idea is to keep collections on a per needs basis.

Folder List

SCCM PowerShell script

Full collections list

  • All Servers
  • All Workstations
  • All Workstations – Admin
  • MC – CS – Workstation Prod
  • MC – CS – Workstation Test
  • MC – CS – Server Prod
  • MC – CS – Server Test
  • MC – EP – Workstation Prod
  • MC – EP – Workstation Test
  • MC – EP – Server Prod
  • MC – EP – Server Test
  • SRV – INV – Physical
  • SRV – INV – Virtual
  • SRV – INV – Windows 2008 and 2008 R2
  • SRV – INV – Windows 2003 and 2003 R2
  • SRV – INV – Windows 2016
  • WKS – INV – Windows 7
  • WKS – INV – Windows 8
  • WKS – INV – Windows 8.1
  • WKS – INV – Windows XP
  • WKS – INV – SCCM Console
  • WKS – INV – Clients Version | 1710
  • WKS – INV – Laptops | Dell
  • WKS – INV – Laptops | Lenovo
  • WKS – INV – Laptops | HP
  • WKS – INV – Microsoft Surface 4
  • WKS – INV – Windows 10
  • WKS – OSD – Windows 10 – PROD
  • WKS – OSD – Windows 10 – TEST
  • WKS – SU – Exclusion
  • WKS – SU – Pilote
  • WKS – SU – TEST
  • WKS – SU – PROD
  • WKS – SD – Office 365 – PROD
  • WKS – SD – Office 365 – TEST

Note: The script will show an error if the collection already exists, but will continue.

Tip: You can comment out any collections that you don’t want using (#) at the beginning of the “New/Add-CMCollection” lines in the “Create Collection” Section.

For more details on this script, see the

Author: Jonathan Lefebvre | Download this script

Create SCCM Collections based on Active Directory OU

List all Organisational Units (OU) Prompt the Administrator to select the topmost OU where they want to start creating Prompt the Administrator for a folder name The script will create the folder in SCCM The script will create 1 collection per OU from the start OU and will create 1 collection for all OU under the start OU. See the example below if it’s unclear. The script will move the collection to the specified folder

Author: Benoit Lecours | Full blog post | Download this script

Create SCCM collections based on Boundary groups

This PowerShell script automatically creates collections based on all the available boundary groups.

Author: Jonathan Lefebvre | Download this script

Delete old SCCM Deployments

This PowerShell script deletes old SCCM Deployments.

The script will prompt the user to enter the desired date and the script will list all deployments older than the specified date.

The user will be prompted before each deployment deletion before going to the next one.

The script supports the deletion of the following deployment type :

  • Applications
  • Packages
  • Task Sequences
  • Configuration Baseline
  • Software Update

Use this script if you have been using SCCM for a couple of years and have completed / old deployments that are still active.

Author: Benoit Lecours | Download

Delete device collections with no members and no deployments

This SCCM Powershell scripts will detect and delete SCCM Collections that have no members and no deployment assigned to it.

This can be useful for deleting unused/unneeded collections.

The script will detect the targeted collections The script will prompt the user for a confirmation before each deletion The script will not delete collections that have custom security scope

Author: Benoit Lecours | Download

SCCM Report Manager Tool

This Powershell script will let you manage your report on an SCCM Reporting Point. This tool is really useful if you download one of our reports

Based on your SCCM Reporting Point and SCCM site code, the tool allows you to :

  • Upload multiple reports from a specific folder — Useful if you have multiple RDL files to upload at once.
  • Download all reports from a specific SSRS folder — Useful if you have multiple custom reports and are migrating to a new reporting point
  • Change data source of all reports from a specific SSRS folder — Useful if you upload multiple new reports and need to change their data sources

The script needs PowerShell 2.0 and has been tested on SQL 2012 and SQL 2016 Reporting Point.

Author: Benoit Lecours | Download

Comments (0)