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

How to detect Office bitness with MEMCM global condition

Jonathan LefebvreSCCM6 Comments

I recently came across an issue where a MEMCM) Global condition was detecting the Office bitness (architecture), but only to one specific version(example below). This lead to a requirement issue where the computer was running another version of Office that wasn’t covered by the global condition. With that said, we still needed a requirement only for the architecture of Office, while the version was not that important for now. I’ve uploaded a new script to Technet Gallery that returns the Office Bitness no matter what version is installed (from Office XP to the latest). In this post, I’ll describe how to use the script with a MEMCM global condition as a requirement for an application. MEMCM Global Condition Office Bitness Requirement Download the Office Bitness detection script from Github The script The script is looking at the Bitness registry key of Outlook. The script will return the value of Bitness. … Read More

Deploy PowerShell Scripts using SCCM 1706

Benoit LecoursSCCM26 Comments

SCCM Deploy PowerShell Script

Beginning with SCCM 1706, you can now run and deploy Powershell script from the SCCM console. In addition, all directly from the SCCM console you can: edit your scripts, import existing scripts, approved or deny scripts, run script on specific collections and examine the scripts results. This can be useful to run a script quickly without the burden of creating a package or an application. Unlike standard deployments, when you deploy scripts, they are run almost immediately using Client Operations. This feature is still in pre-release version and needs to be enabled manually before using it. Prerequisites for SCCM Deploy PowerShell Script Before using scripts on your clients you need : SCCM 1706 Create and Run scripts pre-release features enabled Targeted clients must have client version 1706+ Clients must be running PowerShell v3.0+ Have the necessary SCCM permissions Enable Create and Run Scripts Feature Open the SCCM Console Go to your Administration / … Read More

PowerShell Script to delete Collections older than X Days under Specific Folder

Nicolas PilonPowershell, SCCM1 Comment

Did you ever wanted to delete a bunch of collections older than x days under specific folder name? I recently needed to clean collections older than 7 days under specific folders. The reason was simple, I came across a situation where the company own a custom package deployment solution and it create a collection each time a deployment is made. Since they are all limited collections, you can imagine the load it can create for the collection evaluator. The best solution would be to delete the collection as soon the deployment is succeeded, some internal politics prevents us to do that. Instead of doing it one by one, I decided to create an automate PowerShell script that run each week. The PowerShell script create a small report in a text file including the list of collections ID deleted. The file will be sent by email as an attachment and will be … Read More