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,404 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Jenne Li-MSFT 1,080 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


  2. BMcclane 0 Reputation points
    2025-01-14T06:54:10.9466667+00:00

    Hello Jeanne,

    I appreciate your response. Below are my comments.

    1. I use the built-in administrator in AD to login to the Exchange server and perform the uninstall operation.
    2. I tried disabling the Windows Defender service through the registry, but it didn't help.
    3. As per the suggestion in a different Microsoft forum, I tried taking ownership of a registry key related to Defender, which didn't work.
    4. I wasn't using Powershell to uninstall the program; instead, I used the control panel.
    5. No backup agent of any kind is running on the server.
    6. As a precaution recommended in another forum, I disabled the mailbox database and store, so I won't be able to create a new mailbox at the moment. Yet, I'm trying the procedure with AD's built-in administrator account. I also tried using a different account, which is a member of all the above-mentioned groups, which resulted in the same error.

    Any help to resolve the issue would be really great.

    Thanks,

    Bruce

    0 comments No comments

  3. BMcclane 0 Reputation points
    2025-01-14T10:58:05.4266667+00:00

    I also tried disabling all Exchange services in the Exchange server and running the uninstall program, but I still received the same error about the MpsSVC service not being able to start/stop by the Windows Defender program. I'm stuck. I need help completely removing the Exchange organization from the premises. I'm now having a broken Exchange server/organization. This Exchange server is the only one with all the necessary roles.

    0 comments No comments

  4. BMcclane 0 Reputation points
    2025-01-14T11:08:29.8566667+00:00

    I get the same error when I try to run the uninstallation process through PowerShell (as administrator and logged in as the AD's built-in administrator). My entire AD forest is stuck. Please help!

    0 comments No comments

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.