Force Reinstall an Intune App with PowerShell

Sometimes a Microsoft Intune application needs to be reset because installation data is stuck or the app must be forced to reinstall. This PowerShell tool helps by loading a list of apps from a CSV file, letting the operator choose one, and then cleaning up related Intune Management Extension registry entries. It also reminds the user to restart the device and sync in Company Portal after the cleanup.

What the script does

The script reads application entries from a local Apps.csv file and shows them in a graphical selection window. After an app is selected, it checks whether the application still appears to be installed and, if necessary, asks for a manual uninstall before continuing. It then removes matching Intune Management Extension registry entries for the selected AppID and finishes with a restart and sync reminder.

Requirements

  • PowerShell script file (.ps1).
  • Apps.csv stored in the same folder as the script.
  • Administrative privileges.
  • Out-GridView available on the system.

Ja — hier ist der ergänzte Abschnitt auf Englisch, passend zu deinem Blogpost und mit der Erklärung genau so, wie es im Script gemeint ist:

CSV file structure

The script expects a file named Apps.csv in the same directory as the PowerShell script. The file must use a semicolon as delimiter and contain the following three columns: ApplicationShortName, and AppID. The Application column is the display name shown in the selection window, while the AppID column is the unique Intune application ID used later to locate and remove the related registry entries. The ShortName column is only used to identify whether the selected application still appears to be installed on the device.

Example structure:

Application;ShortName;AppID
7-Zip 24.08 (MSI-x64);7-Zip;6c3ea4df-0362-4f76-b7b9-6feea87f1288
Greenshot 1.2.10.6;Greenshot;03940c5e-bfab-4265-b669-aec94c33b711
KeePass 2.58.0 (MSI);KeePass;37e9bbfc-d194-4982-be34-e8d12634ebd2
Office 365 x32 en-US;Office;cb3d3f28-9140-48e9-91e0-611ef7994822
Office 365 x64 en-US;Office;fdab9780-ac85-46ff-880d-47de8474f602
Office 365 x64 de-DE;Office;e71f3a84-06d4-4957-a55d-66e4c39f755b
PDF-XChange 10.6.0.396 x64;PDF-XChange;aa0487f4-5aff-475d-8099-f652a08a0b66

Note about ShortName

The second column, ShortName, is not used for the Intune cleanup itself. It is only used in the script to check whether the selected application still seems to be installed by matching it against installed packages on the system. This is why the value should be short and practical, for example OfficeKeePass, or 7-Zip, so the package lookup can detect an existing installation more reliably. The actual cleanup of Intune-related registry entries is based on the AppID, not on ShortName.

Practical notes

This approach is useful when a Win32 app deployment gets stuck in a bad state and a normal reinstall is not enough. Because the script works directly against Intune Management Extension registry data, it should be used carefully and only by administrators who understand the impact. A short manual uninstall step before cleanup helps avoid conflicts during the reinstall process.

GitHub download

Download the script here: GitHub repository.

Schreibe einen Kommentar