Test-WS1AppRemoval
The "EXIT" Strategy for Safe Uninstalls
Cleaning up your Workspace ONE (WS1) console can be a nerve-wracking experience. You want to remove old application assignments or delete legacy app records to keep your environment tidy. But there is always that lingering fear: "If I delete this from the console, will it rip the software off the user's computer?"
The answer lies deep in the Windows Registry, and checking it manually is a nightmare.
Today, I’m sharing a PowerShell tool that acts as your safety net, ensuring that your console cleanup doesn't cause operational chaos.
The Danger Zone: "Delete" vs. "Uninstall"
In Workspace ONE, the behavior of an app removal depends entirely on the Uninstall Command defined in the application's manifest on the device.
- The Safe Zone (
EXIT): If the command is literally the wordEXIT, WS1 essentially says, "Okay, I stop managing this." The app record is removed from the console, but the software remains installed on the user's device. - The Danger Zone (Execution Commands): If the command is an actual instruction (e.g.,
msiexec /x {GUID}orsetup.exe /uninstall), removing the assignment in WS1 will trigger that command, forcefully uninstalling the app from the device.
The Problem: You can't always easily see which apps are configured which way, especially for legacy apps deployed years ago.
The Solution: Get-WS1UninstallInfo
I wrote this script to audit your environment before you make changes. It scans the registry to verify which apps are correctly labeled with EXIT (Safe) and which ones are set to execute a removal command (Risk).
How It Works
The script digs into HKLM:\SOFTWARE\AirWatchMDM\AppDeploymentAgent\AppManifests, parses the DeploymentManifestXML, and validates the CommandLine value inside the uninstall method block.
It specifically looks for the EXIT string.
Why You Need This Audit
If you are planning to unassign an app from a group of users, or delete an app version from the console, you need to know what will happen next.
- Scenario A: You run the script. It confirms App X has the uninstall command
EXIT.- Result: Safe to remove from Console. The app will stay on the user's laptop, but you free up a license or clean up your dashboard.
- Scenario B: You run the script. It reports App Y has the uninstall command
msiexec /x {GUID} /qn.- Result: STOP. If you remove this from the console, the agent will run that command and uninstall the software. You need to push an update to change the uninstall command to
EXITbefore you can safely stop managing it.
- Result: STOP. If you remove this from the console, the agent will run that command and uninstall the software. You need to push an update to change the uninstall command to
The Takeaway
Don't rely on guesswork when managing production endpoints. Use Get-WS1UninstallInfo to verify your "Exit Strategy" is correctly configured. It ensures that when you stop managing an app, you don't accidentally stop your users from working.