Saturday, November 22, 2025

How to Retire the SCCM/MECM application by using PowerShell command line

Retire Multiple Applications in SCCM Using PowerShell

Managing applications in SCCM (ConfigMgr) can become time-consuming when you need to retire multiple apps one by one. To simplify this process, you can use a PowerShell script that reads application names from a text file and retires them automatically.

This script uses the Suspend-CMApplication cmdlet to retire each application listed in applist.txt. It’s a fast and efficient way to bulk-retire applications—perfect for cleanup tasks, environment restructuring, or decommissioning outdated software.


PowerShell Script: Retire Applications

Suspend-CMApplication -Name $applicationname

PowerShell Script: Retire Applications in Bulk

$appname = Get-Content "C:\applist.txt" foreach ($appname1 in $appname) { Suspend-CMApplication -Name $appname1 Write-Host "$appname1 has been retired successfully" -BackgroundColor Green }

How It Works

  1. Input file:
    Create a text file named applist.txt at C:\ containing the list of application names—one per line.

  2. Load the list:
    The script reads each line of the file using Get-Content.

  3. Retire the applications:
    For each app name, the script runs Suspend-CMApplication, which retires the application in SCCM.

  4. Status message:

After each retirement, PowerShell displays a green success message.

No comments: