Microsoft Entra Suite Tech Accelerator
Aug 14 2024, 07:00 AM - 09:30 AM (PDT)
Microsoft Tech Community

Microsoft Azure Information Protection Uninstall Issue

Copper Contributor

We installed AIP installer to ~3000 machines and we deployed v2.13.49.0 to all of our machines last year and didn't upgrade it. We have since had a request in to remove it from all machines, this is fine but we found when testing some were failing the uninstall.


Did a bit of digging to the failures and saw we had multiple newer versions installed,,,


Did a bit more digging and saw that Windows Update has been updating some but not all.


I tried to download the newer versions so I could package then send the uninstall but not all are there to download.


I then went down the GUID to uninstall them which works "SORT OF" but not fully, it uninstalls the app but it is still lingering in the Add/Remove Programs window and is still showing as installed. If I click uninstall in there it goes through the uninstall process and its then gone.


Problem is I do not and cannot get the other version installers as they are no longer available and wondered if anyone has hit this issue yet and if there is some sort or rip out app/script? because this is not good.

2 Replies
Have same issue, and after digging, I found that Microsoft is adding registry entries to AzInfoProtection.exe installers in the "C:\ProgramData\Package Cache" folder. So, I pulled the installers from those locations and packaged each to uninstall if the Cache folder is present with a requirement rule to check. The 2 versions most prevalent for my organization are 2.16.79 and 2.18.26. I'm targeting these for now, since I have those installers and will clean up the rest later.

Package Cache Folder Names:

C:\ProgramData\Package Cache\{c01f4b1d-ef87-4ba5-8dcc-9781bd40da6d}

C:\ProgramData\Package Cache\{265aa462-28d4-4936-ac01-401a7d2e2be5}

@blayman67 Thanks! I also did a bit of digging and found the following on our estate.

VersionGUIDPackage Cache{7F9E039F-3B88-49C0-A464-5759331C6985}{231cba1f-1f89-4827-b80e-93ddc8856b3e}{7175C307-79AA-44E0-A3CB-3016E32B1E17}{d23b4653-ca5a-4517-b2a4-e2edf9d22943}{E771A2D8-44BB-47C5-8D2D-C54EAD014A25}{677ae234-9687-4c07-83c0-b3d5e191adb2}{4AA2D7F5-CF37-48CF-8218-181322ED662A}{c01f4b1d-ef87-4ba5-8dcc-9781bd40da6d}{6de718d8-4790-42a4-8f11-8b0158345c96}{6de718d8-4790-42a4-8f11-8b0158345c96}


Then I created a script to look for each version and have recently deployed it to 200 and it worked totally fine. I put the script in the original deployment so was easier to send Uninstalls out via InTune.


The script also creates log files in C:\Temp with detailed actions what it has done. Hope it helps


# Microsoft AIP ripout script
# Created by : ASB
# Date: 02/05/24
# This script is only to be used for the ripout of AIP 

# GUIDs for the annoying first applications to be uninstalled and the linked GUIDs
# versions in order below GUIDS are,,,,
$guids = @{
    "7F9E039F-3B88-49C0-A464-5759331C6985" = "231cba1f-1f89-4827-b80e-93ddc8856b3e";
    "7175C307-79AA-44E0-A3CB-3016E32B1E17" = "d23b4653-ca5a-4517-b2a4-e2edf9d22943";
    "E771A2D8-44BB-47C5-8D2D-C54EAD014A25" = "677ae234-9687-4c07-83c0-b3d5e191adb2";
    "4AA2D7F5-CF37-48CF-8218-181322ED662A" = "c01f4b1d-ef87-4ba5-8dcc-9781bd40da6d";
    "B8F9AFA8-C1C2-4DCE-AF83-34349F9ADF0B" = "6de718d8-4790-42a4-8f11-8b0158345c96";

# Log file location
$logFile = "C:\Temp\AIPRemoval.log"

# Old Loggy Logs
function Log-Message {
    $timestamp = Get-Date -Format "dd-MM-yyyy HH:mm:ss"
    "$timestamp - $Message" | Out-File -Append -FilePath $logFile

# Start time
$startTime = Get-Date
Log-Message "Script execution started."

# Loop through each GUID and attempt to uninstall
foreach ($guid in $guids.Keys) {
    $startTimeGuid = Get-Date
    Log-Message "Processing GUID: $guid (Start Time: $startTimeGuid)"
    try {
        $uninstallString = "msiexec.exe /x {$guid} /qn /norestart"
        Log-Message "Preparing to execute uninstall command: $uninstallString"
        $output = Start-Process "cmd.exe" "/c $uninstallString" -Wait -PassThru -ErrorAction Stop
        Log-Message "Uninstall command executed - ExitCode: $($output.ExitCode)"
        if ($output.ExitCode -eq 0) {
            Log-Message "Uninstallation successful for GUID: $guid"
            # Check and run secondary uninstall command if primary was successful
            $linkedGuid = $guids[$guid]
            $secondaryUninstallPath = "C:\ProgramData\Package Cache\{$linkedGuid}\AzInfoProtection.exe"
            Log-Message "Checking for secondary uninstall executable at: $secondaryUninstallPath"
            if (Test-Path $secondaryUninstallPath) {
                $secondaryUninstallCmd = "`"$secondaryUninstallPath`" /uninstall /quiet /norestart"
                Log-Message "Executing secondary uninstall command: $secondaryUninstallCmd"
                $secondaryOutput = Start-Process "cmd.exe" "/c $secondaryUninstallCmd" -Wait -PassThru
                Log-Message "Secondary uninstall command executed - ExitCode: $($secondaryOutput.ExitCode)"
            } else {
                Log-Message "Secondary uninstall executable not found."
        } else {
            Log-Message "Uninstallation failed for GUID: $guid - Exit Code: $($output.ExitCode)"
    } catch {
        Log-Message "Exception occurred while uninstalling GUID: $guid - Error: $_"

    $endTimeGuid = Get-Date
    $durationGuid = $endTimeGuid - $startTimeGuid
    Log-Message "Completed processing GUID: $guid (End Time: $endTimeGuid, Duration: $durationGuid)"

# End time and how long it took
$endTime = Get-Date
$totalTime = $endTime - $startTime
Log-Message "Script execution completed."
Log-Message "Total duration: $($totalTime.ToString())"

# Write to the logs
Log-Message "All operations have finished."