Unable to Uninstall Exchange server 2016 in a Windows server 2025

BMcclane 0 Reputation points
2025-01-13T16:24:20.98+00:00

We have recently performed an in-place upgrade to the Exchange server (Which was running Windows server 2016) to the Windows server 2025. The upgrade went smoothly. We then tried uninstalling the Exchange server role, considering we are entirely into the M365. However, we encountered a problem where the readiness check threw an error, as shown below.

Error:

The following error was generated when "$error.Clear();

      if (Get-Service MpsSvc* | ?{$_.Name -eq 'MpsSvc'})

      {

        Set-Service MpsSvc -StartupType Automatic

        Start-SetupService -ServiceName MpsSvc

      }

    " was run: "Microsoft.PowerShell.Commands.ServiceCommandException: Service 'Windows Defender Firewall (MpsSvc)' cannot be configured due to the following error: Access is denied ---> System.ComponentModel.Win32Exception: Access is denied

The Windows Defender service is running already, and I'm using an enterprise admin account (in AD), which is also a member of the OrganisManagement Group in AD. We need to remove the Exchange server app from the server, and then we can remove the trace of Exchange in AD.

Exchange Server
Exchange Server
A family of Microsoft client/server messaging and collaboration software.
1,422 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jenne Li-MSFT 1,235 Reputation points Microsoft Vendor
    2025-01-14T06:06:23.4033333+00:00

    Hi @BMcclane ,

    Thanks for posting your question in the Microsoft Q&A forum.

    According to your description, when you uninstall the Exchange server role, the readiness check throws an error. To identify the cause of the issue more accurately, can you provide and try the following information:

    1. Can you confirm that you have logged on to the server using a domain administrator user account and not a local administrator user account? And you need to open the PowerShell console with "Run as Administrator" permissions.
    2. Have you shut down EMS and any other programs that may delay the uninstall process (for example, .NET assemblies, antivirus software, and backup agents)?
    3. You can try to create a brand new Exchange user mailbox, and the user needs to be a member of the Domain Admins, Enterprise Admins, Schema Admins, Organization Admins, and Local Admins groups on the affected workstation, then log on to the workstation and try to uninstall Exchange again.

    If you have any questions, please feel free to contact me. If the answer is helpful, please click "Accept Answer" because it can help other members of the Microsoft Q&A community who have encountered similar problems and are looking for solutions. Thank you.

    Best,

    Jeanne


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.