SCCM PowerShell Script to Delete Unused Collection

Benoit LecoursSCCM1 Comment

Are you using an SCCM Script to Delete your collection? From all SCCM management activities, collections are arguably the most important object to know about. Collection evaluation, if not configured correctly can have a huge impact on your SCCM hierarchy. This Powershell script will detect and delete SCCM Devices Collections that have no members and no deployment assigned to them. This can be useful to delete unused/unneeded collections. We often see lots of these “orphan” collections after years of management. The less collection, the fewer evaluation task for your server. Why would you want to consume server resources on collections that are useless? Even worst, if you are using incremental collection refresh, it could slow down considerably your server. You can do the whole process manually but it will be difficult to identify and fastidious to delete all collections one by one. This is where Powershell becomes really useful and saves … Read More

Using SCCM Collection variables in Task Sequence

Benoit LecoursOSD, SCCM28 Comments

For this post, I’ve built a little scenario to explain how to use SCCM Collection variables in Task Sequence. I get often asked how to reduce the number of SCCM task sequences and how to make them dynamic. I’m always surprised when I hear from an SCCM administrator that they don’t use variables in their task sequence. Let’s say you are working in an international company and use SCCM to deploy operating systems. Each office has its own configuration and specific software to install. You decide to create 1 task sequence per office. Wrong! You’ll end up in a management nightmare. One task sequence is often enough and this is where you need variables to the rescue. The magic that you need to understand is collection variables. You have 2 choices, let the user enter the variable value at the beginning of the deployment (explain later) or pre-load these values using collection … Read More

Create Operational SCCM collection using PowerShell script

Benoit LecoursPowershell, SCCM26 Comments

Using Powershell you can do many things in SCCM. 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 … Read More

SCCM Powershell collection boundary groups

Jonathan LefebvrePowershell, SCCM2 Comments

With SCCM 2002 that was just released, a small but extremely useful feature is now available in console. It is now possible to view what boundary group a device is connected to! This offers a new opportunity with collections based on Boundary groups, which could mean physical sites or any other meaningful needs in your environment. I’ve created a PowerShell script that automatically creates collections based on all the available boundary groups. Requirements SCCM must be at least version 2002. See our Step-by-step guide upgrade guide here SCCM Powershell collection boundary groups The script can be downloaded on GitHub, since Technet Gallery is retiring soon. Be sure to rate the submission if you are using it. Example of the result of the script Collection query for boundary groups Thanks to fellow SystemCenterDudes, Eswar Koneti, for his post about that exact query This isn’t the typical query for collections Note that … Read More

SCCM Powershell Script to create Collections Folders

Jonathan LefebvrePowershell, SCCM2 Comments

Following the excellent PowerShell script that Benoit wrote to create operational collection, I decided to rethink it a bit to help classify collections and ease Role-based administration control implementation when a different group of users accesses SCCM. On top of that, the way folders for collections are designed, it helps implement a naming convention to keep things clear all across the SCCM console. This script works with any SCCM version. The overall idea is to keep collections on a per needs basis. Having a collection that receives client settings, 1-2 applications, OSD and Windows Updates can lead to unplanned/accidental deployment or misconfiguration. With one collection per need, everything is well targeted. I also prefer to have collection for inventory to feed my deployment collections, instead of always recreating the queries. I’ve been using the same methodology for years at multiple clients site. When I go back after a few years, … Read More

How to configure SCCM Device Categories

Benoit LecoursSCCM2 Comments

Beginning with SCCM 1606, you can create device categories to automatically add devices into device collections when you are using SCCM and Intune in a hybrid scenario. (In a standalone scenario, this feature is named Device group mapping). At enrollment time, the mobile users are required to choose a device category. Once a device category is selected, the device is added to the corresponding collection based on a new collection membership : Device Category Rule. Device categories can also be set manually on a single device using the SCCM Console. Here’s everything you need to know in order to manage this new features : Create SCCM Device Categories Open the SCCM Console Go to Assets and Compliance / Device Collections On the top ribbon, click Manage Device Categories In the Manage Device Categories dialog box, you can create, edit, or remove categories. For our post, we will be creating a Test category Create Device Category Rule When you associate a collection with … Read More

How to use SCCM Dynamic Queries in your Deployment Collections

Stephane FaubertSCCM7 Comments

In this post we will be looking at using SCCM dynamic queries to populate collections in our deployments. As a SCCM administrator, you most likely had to plan out mass deployments to all your servers or workstations or even both. How did you go ahead and populate your collections? Queries? Since the introduction of SCCM 2012, we now have a multitude of options, most notably: Direct membership Queries Include a collection Exclude a collection Chances are, if you are deploying a new software to be part of a baseline for workstations (for example), you will also add it to your task sequence. In my passed life, I must admit, I really did like queries. They can be such a powerful tool to populate your collections. I always was looking for ways to pimp the usual types of queries we use. For example, my fellow dude Benoit has given us a fabulous … Read More

How to manage your Distribution Points with Collections

Jonathan LefebvreSCCMLeave a Comment

Do you have a high number of distribution point in your SCCM environment? Managing large SCCM environment with many Distribution Point or Pull Distribution Point is not an easy task. We’ve done a great post on 8 ways to monitor your Distribution Point, it was most related to the console monitoring and reports. We also provided a report to manage content on your Distribution Point. Additionally, you can use collections to regroup Distribution Point based on specific information. The advantage of using collections is that an action that can be taken based on the membership. (compliance settings, applications, etc.) This post will explain various tips to improve your day to day SCCM Distribution Point Management. Collection query to get all Distribution Points First of all, we will create a collection to keep track of computers acting as Distribution Point or to target members of a Distribution Points Group. Create a new collection and use this … Read More

Step-by-Step SCCM 2012 R2 SP1 CU1 Installation Guide

Benoit LecoursSCCM60 Comments

Cumulative Update 1 (CU1) for SCCM 2012 R2 SP1 and SCCM 2012 SP2 is now available. This post is a complete step-by-step SCCM 2012 R2 SP1 CU1 Installation guide. If you’re looking for a complete SCCM 2012 installation guide, see our blog series which covers it all. Installing SCCM cumulative updates is very important to your infrastructure. It fix lots of issues, which some of them are important. As this is the first post-R2 SP1 cumulative update, the important requirement for the installation is that SCCM 2012 R2 SP1 is installed. The latest non-R2 SP1 cumulative update is CU5. Don’t get confused, this CU could have been named CU6 (chronologically wise) but Microsoft has decided to reset the numbering due to the Service Pack release. See our SCCM 2012 versions post to have a clear view of all build numbers. Improvements/Fixes The major new functionality of CU1 is the Automatic Client Upgrade feature during CU setup wizard. This will … Read More

Our favorite SCCM 2012 R2 SP1 New Features

Benoit LecoursSCCM7 Comments

Microsoft announced the release of SCCM 2012 SP2 and SCCM 2012 R2 SP1. This service pack includes tons of new features. We covered the complete installation, now we decided to compile a list of our favorite SCCM 2012 R2 SP1 new features and we’ll be describing how to enable them and explain why they made the cut. Preferred Management Points Official description from Technet : Preferred management points enable a client to identify and prefer to communicate with a management point that is associated with its current network location or boundary. When configured, a client attempts to use a preferred management point from its assigned site before using a management point from its assigned site that is not configured as preferred. Basically it means that you can assign your clients to a preferred management points like you did in the past for content (Distribution Points) using boundary groups. Cumulative Update 3 had a similar concept of Management Point affinity but it was not configurable … Read More