Hello.
We have a lot of exchange servers in our organization and sometimes we need to uninstall exchange for re-organizing environment. It is easier to add new server migrate stuff there and then uninstall old servers.
During such tasks I have found that it is impossible to uninstall Exchange 2016 CU23, while other versions were uninstalling with no problem.
When I uninstall exchange server uninstall successfully runs throug removing Mailbox role, removes object from AD organization, but then follows to uninstall Unified Messaging Role and fails on
Error:
The following error was generated when "$error.Clear();
uninstall-MsiPackage -ProductCode $RoleProductCode -LogFile $RoleLogFilePath -PropertyValues ("ESE=1");
$lochost=hostname;
$exchsrv=Get-ExchangeServer -Identity $lochost -DomainController $RoleDomainController;
if (-not $exchsrv.IsMailboxServer)
{
uninstall-MsiPackage -ProductCode $RoleTeleProductCode -LogFile $RoleLogFilePath;
}
if ( $RoleTransProductCode -ne [system.guid]::empty )
{
uninstall-MsiPackage -ProductCode $RoleTransProductCode -LogFile $RoleLogFilePath;
}
uninstall-MsiPackage -ProductCode $RoleTtsProductCode -LogFile $RoleLogFilePath;
" was run: "Microsoft.Exchange.Configuration.Tasks.ManagementObjectNotFoundException: The operation couldn't be performed because object 'MBX' couldn't be found on 'DC'.
at Microsoft.Exchange.Configuration.Tasks.Task.ThrowError(Exception exception, ErrorCategory errorCategory, Object target, String helpUrl)
at Microsoft.Exchange.Configuration.Tasks.GetObjectWithIdentityTaskBase`2.InternalProcessRecord()
at Microsoft.Exchange.Configuration.Tasks.Task.<ProcessRecord>b__91_1()
at Microsoft.Exchange.Configuration.Tasks.Task.InvokeRetryableFunc(String funcName, Action func, Boolean terminatePipelineIfFailed)".
This error is absolutely legit - because there's no such exchange server in organization anymore. Uninstall already removed it on previous step. Why it works this way I have no idea. There're no way I could find to at first remove unified messaging role and only after that proceed with removing mailbox role. Also, to my surprise there're no way to repair this installation - nothing helps. uninstall from command prompt, repair, try for reinstall failed installation - nothing helps.