Saturday, November 22, 2025

Bulk Remove SCCM Applications and Their Distribution Points Using PowerShell

Managing applications in Microsoft Endpoint Configuration Manager (MECM/SCCM) can become time-consuming—especially when you need to remove multiple applications along with their associated Distribution Points (DPs) or DP Groups.

To simplify this process, here’s a PowerShell script that:

✔ Reads application names from a text file
✔ Removes associated Distribution Point Groups
✔ Removes individual Distribution Points
✔ Deletes the application from the MECM database
✔ Displays progress and success messages in the console

This script is very helpful during environment cleanups, migrations, or when retiring large numbers of outdated applications.

PowerShell Script: Bulk Application & DP Cleanup in SCCM

$application = Get-Content "C:\applicationlist.txt" Write-Host "Application removal initiated, Please wait..." -BackgroundColor DarkMagenta foreach ($applicationname in $application) { # Removing associated DP group from application Write-Host "Application Name: $applicationname" -BackgroundColor Blue Write-Host "Removing associated DP group and DP from the application..." -BackgroundColor Gray Remove-CMContentDistribution -ApplicationName $applicationname -DistributionPointGroupName "Enter the distribution group Name" -Force Remove-CMContentDistribution -ApplicationName $applicationname -DistributionPointName "Enter the DP Name" -Force Write-Host "$applicationname - Associated DP group and DP removed successfully." -BackgroundColor Green Write-Host "Please wait..." -BackgroundColor Gray # Removing application from SCCM DB Write-Host "Removing application from MECM database..." -BackgroundColor Gray Get-CMApplication -Name "$applicationname" | Remove-CMApplication -Force Write-Host "Successfully removed application: $applicationname" -BackgroundColor Green }


📂 Preparing the Application List

Create a simple text file at:

C:\applicationlist.txt

Add each application name on a new line—names must match exactly as shown in MECM:

Google Chrome Mozilla Firefox Adobe Reader WinRAR

▶️ How the Script Works

1. Load application names

The script reads each application from the text file using Get-Content.

2. Remove DP Group & DP associations

It removes:

  • The assigned Distribution Point Group

  • The assigned Distribution Point

This ensures MECM doesn’t block deletion due to content distribution.

3. Remove the application from MECM

After cleanup, the script removes each application using:

Remove-CMApplication -Force

4. Shows clear status messages

Colored console messages indicate progress and completion.


⚠️ Important Notes Before Running

  • Run this script in the Configuration Manager PowerShell environment.

  • Replace the placeholders:

    • "Enter the distribution group Name"

    • "Enter the DP Name"

  • Ensure you have Application Administrator or higher permissions.

  • Test the script in a non-production environment first.

  • This script permanently deletes applications, so proceed cautiously.


✔️ Benefits of Using This Script

  • Saves hours of manual cleanup

  • Automates DP and DP group removal

  • Avoids MECM dependency errors

  • Ensures consistent and repeatable cleanup

  • Ideal for large-scale environment maintenance

No comments: