#Requires -Version 5.1 <# JbTecWiz Support Centre -- read-only diagnostic Fault : An add-in keeps disabling itself, or will not stay enabled Source: https://jbtecwiz.com/support/win-office-addin-disabled This script CHANGES NOTHING. It runs only the inspection commands from the write-up -- the Get-, Test- and Resolve- calls that establish which cause is in play -- and prints what each returned. Anything that writes, deletes, starts or stops is excluded by construction, not by judgement. Read the output alongside the write-up, then pick the fix that matches. Each fix has its own script on the same page. #> [CmdletBinding()] param([switch]$Transcript) $ErrorActionPreference = 'Continue' if ($Transcript) { $log = Join-Path $env:USERPROFILE ("jbtecwiz-win-office-addin-disabled-" + (Get-Date -Format yyyyMMdd-HHmmss) + ".txt") Start-Transcript -Path $log | Out-Null Write-Host (' Saving a transcript to ' + $log) } function Write-Rule { param([string]$Text) Write-Host '' Write-Host ('-' * 70) -ForegroundColor DarkGray if ($Text) { Write-Host $Text -ForegroundColor Cyan } } function Probe { param([string]$Label, [string]$Fix, [scriptblock]$Command) Write-Rule (" " + $Label) Write-Host (" from: " + $Fix) -ForegroundColor DarkGray Write-Host '' foreach ($l in ($Command.ToString().Trim() -split "`n")) { Write-Host (" " + $l.Trim()) -ForegroundColor DarkGreen } Write-Host '' try { $out = & $Command 2>&1 | Out-String if ([string]::IsNullOrWhiteSpace($out)) { Write-Host ' (returned nothing)' -ForegroundColor DarkGray } else { foreach ($l in ($out.TrimEnd() -split "`n")) { Write-Host (" " + $l.TrimEnd()) } } } catch { Write-Host (" could not run: " + $_.Exception.Message) -ForegroundColor Yellow } } Write-Rule Write-Host ' An add-in keeps disabling itself, or will not stay enabled' -ForegroundColor White Write-Host ' Read-only diagnostic -- nothing is changed.' -ForegroundColor Green Write-Rule Probe -Label 'Look at what is on the lists, for every application at once.' -Fix 'Clear the resiliency lists' -Command { Get-ChildItem 'HKCU:\Software\Microsoft\Office\16.0' -ErrorAction SilentlyContinue | ForEach-Object { $p = Join-Path $_.PSPath 'Resiliency'; if (Test-Path $p) { Get-ChildItem $p | Select-Object @{n='App';e={$_.PSParentPath.Split('\')[-2]}}, PSChildName } } } Probe -Label 'Verify: The add-in is present after two or three full restarts of the application.' -Fix 'Clear the resiliency lists' -Command { Test-Path 'HKCU:\Software\Microsoft\Office\16.0\Outlook\Resiliency\DisabledItems' } Probe -Label 'Confirm the add-in''s architecture matches Office. A 32-bit COM add-in will not load into 64-bit Office at all, and this produces exactly the silent absence being reported.' -Fix 'Check what the add-in is registered to do' -Command { Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration' | Select-Object Platform } Probe -Label 'Get the add-in''s ProgID exactly as registered.' -Fix 'Stop Office disabling a known-good add-in across the estate' -Command { Get-ChildItem 'HKCU:\Software\Microsoft\Office\Excel\Addins' | Select-Object PSChildName } Write-Rule Write-Host ' Diagnostic finished. Nothing was changed.' -ForegroundColor Green Write-Host '' Write-Host ' Compare the output above with the write-up, then run the' Write-Host ' script for the fix that matches:' Write-Host ' https://jbtecwiz.com/support/win-office-addin-disabled' Write-Rule if ($Transcript) { Stop-Transcript | Out-Null }