How to use SCCM Dynamic Queries in your Deployment Collections

Benoit LecoursSCCM7 Comments

In this post, we will be looking at using SCCM dynamic queries to populate collections in our deployments. As an 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 new software to be part of a baseline for workstations (for example), you will also add it to your task sequence. In my past 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, we developed a fabulous list of operational collections that we … Read More

Create 148 Operational SCCM Collections using this Powershell Script

Benoit LecoursPowershell, SCCM28 Comments

Using Powershell you can do many things in SCCM. Over the years, in many SCCM consulting projects 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 SCCM operational collections which we create just after an SCCM installation. With time, I added more and more collections to the script. Fast forward to today, the script now contains 148 collections and has been downloaded more than 75 000 times making this PowerShell script 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. In about 5 minutes, you’ll end up having 148 collections in an Operational folder. The collections are set to … Read More

SCCM Remove Computer from Collection after OSD

Benoit LecoursPowershell, SCCM1 Comment

This post is a step-by-step guide on how to remove computers from the collection after OSD. If you’re using specific collections for your OSD deployments you certainly know that the collections are not emptied automatically. After a couple of weeks, you’ll end up with a collection full of systems. The bad news is that there’s nothing built-in in the product, the good news is that our friend PowerShell can do this dirty job. To run the script : The imported module needs to be trusted The script must run in x86 mode The computer account must have proper permission (SCCM and DCOM) SCCM Remove Collection OSD – Permission You need to add your primary site computer account as a “Full Administrator” in SCCM You need to add the “System” account “Remote Access” right in DCOM permission Launch “dcomcnfg.exe” Navigate to Component Services / Computer / My Computers (Right-Click) / Properties … Read More

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

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 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