Microsoft Exchange Server 2016 Uninstall Error

When attempting to uninstall Exchange 2016 one a couple of the servers I got this error after running the setup.exe with the uninstall switch. The uninstallation obviously failed and would not go any further.

First thing was to reboot the server and retry, but that still didn’t work.

[07/03/2026 15:18:33.0520] [2] User specified parameters: -Name:'C:\Windows\system32\regsvr32.exe' -Args:'/s /u "C:\Program Files\Microsoft\Exchange Server\V15\bin\ExSMIME.dll"' -Timeout:'120000' 
[07/03/2026 15:18:33.0520] [2] Beginning processing start-SetupProcess 
[07/03/2026 15:18:33.0520] [2] Starting: C:\Windows\system32\regsvr32.exe with arguments: /s /u "C:\Program Files\Microsoft\Exchange Server\V15\bin\ExSMIME.dll" 
[07/03/2026 15:18:33.0603] [2] Process standard output: 
[07/03/2026 15:18:33.0603] [2] Process standard error: 
[07/03/2026 15:18:33.0604] [2] [ERROR] Process execution failed with exit code 5. 
[07/03/2026 15:18:33.0607] [2] [ERROR] Process execution failed with exit code 5. 
[07/03/2026 15:18:33.0610] [2] Ending processing start-SetupProcess 
[07/03/2026 15:18:33.0613] [1] The following 1 error(s) occurred during task execution: 
[07/03/2026 15:18:33.0613] [1] 0. ErrorRecord: Process execution failed with exit code 5. 
[07/03/2026 15:18:33.0613] [1] 0. ErrorRecord: Microsoft.Exchange.Configuration.Tasks.TaskException: Process execution failed with exit code 5. at Microsoft.Exchange.Management.Tasks.RunProcessBase.InternalProcessRecord() at Microsoft.Exchange.Configuration.Tasks.Task.<ProcessRecord>b__91_1() at Microsoft.Exchange.Configuration.Tasks.Task.InvokeRetryableFunc(String funcName, Action func, Boolean terminatePipelineIfFailed) 
[07/03/2026 15:18:33.0614] [1] [ERROR] The following error was generated when "$error.Clear(); $dllFile = join-path $RoleInstallPath "bin\ExSMIME.dll"; $regsvr = join-path (join-path $env:SystemRoot system32) regsvr32.exe; start-SetupProcess -Name:"$regsvr" -Args:"/s /u "$dllFile"" -Timeout:120000; " was run: "Microsoft.Exchange.Configuration.Tasks.TaskException: Process execution failed with exit code 5. at Microsoft.Exchange.Management.Tasks.RunProcessBase.InternalProcessRecord() at Microsoft.Exchange.Configuration.Tasks.Task.<ProcessRecord>b__91_1() at Microsoft.Exchange.Configuration.Tasks.Task.InvokeRetryableFunc(String funcName, Action func, Boolean terminatePipelineIfFailed)". 
[07/03/2026 15:18:33.0614] [1] [ERROR] Process execution failed with exit code 5. 
[07/03/2026 15:18:33.0614] [1] [ERROR-REFERENCE] Id=TransportCommonComponent___194ab1f52c3c424d917a08973d87801d Component=EXCHANGE14:\Current\Release\Shared\Datacenter\Setup 
[07/03/2026 15:18:33.0614] [1] Setup is stopping now because of one or more critical errors. 
[07/03/2026 15:18:33.0614] [1] Finished executing component tasks. 
[07/03/2026 15:18:33.0624] [1] Ending processing Uninstall-FrontendTransportRole 
[07/03/2026 15:18:33.0626] [0] CurrentResult console.ProcessRunInternal:198: 1 
[07/03/2026 15:18:33.0630] [0] CurrentResult launcherbase.maincore:90: 1 
[07/03/2026 15:18:33.0631] [0] CurrentResult console.startmain:52: 1 
[07/03/2026 15:18:33.0631] [0] CurrentResult SetupLauncherHelper.loadassembly:452: 1 
[07/03/2026 15:18:33.0631] [0] The Exchange Server setup operation didn't complete. More details can be found in ExchangeSetup.log located in the <SystemDrive>:\ExchangeSetupLogs folder. 
[07/03/2026 15:18:33.0635] [0] CurrentResult main.run:235: 1 
[07/03/2026 15:18:33.0635] [0] CurrentResult setupbase.maincore:396: 1 
[07/03/2026 15:18:33.0635] [0] End of Setup 
[07/03/2026 15:18:33.0635] [0] ****************************************

Resolution

Turns out this is a fairly well known issue, And to resolve you need to follow these steps:

The issue could be resolved by following these steps:

1. Firstly restart the server and then attempt the uninstall again. If this doesn’t work continue with this procedure.

2. Open a Command Prompt (as Administrator).

3. Go to: C:\Program Files\Microsoft\Exchange Server\V15\bin\

4. Rename ExSMIME.dll to ExSMIME.dll-old or any other name you wish.

5. Make a copy of exmime.dll (notice this is a different file althogether), and then immediately rename exmime.dll to ExSMIME.dll. Now you have effectively replaced the ExSMIME.dll file with a new one.

6. Reattempt the removal, you should now find it works as expected.

Run Setup.exe /mode:Uninstall /IAcceptExchangeServerLicense

https://techcommunity.microsoft.com/blog/exchange/released-september-2016-quarterly-exchange-updates/605402/replies/605443

Leave a comment