none
Correctly uninstall Exchange 2013

    Question

  • Hi, we have an intranet domain where an Exchange 2013 was installed for testing purposes. This is no more used and can be deactivated. Now I need to format the server where Exchange was installed. I'd like to know if there are preliminary actions to perform... do I need to uninstall exchange? How? What about active directory? I don't want to affect existings domain users or other AD things. Thank you
    • Edited by maurice7785 Wednesday, April 13, 2016 9:06 AM
    Wednesday, April 13, 2016 9:01 AM

Answers

  • Hi,

    We need remove all mailbox (include arbitration mailbox and monitoring mailbox), then remove all mailbox database before uninstall Exchange server.

    Please follow below steps to uninstall Exchange server:
    1. Disable mailbox:

    Get-User | Disable-Mailbox
    Get-Mailbox -Arbitration | Disable-Mailbox -Arbitration -DisableLastArbitrationMailboxAllowed
    Get-Mailbox -Monitoring | Disable-Mailbox

    2. Remove restore mailbox for disconnected or soft-deleted mailbox:

    Get-Mailbox | Get-MailboxStatistics | Where {$_.DisconnectReason -eq “Disabled” } | |foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState Disabled}
    Get-Mailbox | Get-MailboxStatistics | where {$_.DisconnectReason -eq “SoftDeleted”} |foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}

    3. Remove database:

    Get-MailboxDatabase | Remove-MailboxDatabase

    4. Remove partner application configuration:

    Get-PartnerApplication| Remove-PartnerApplication

    5. Verify nothing is left:
    Get-Mailbox
    Get-Mailbox -Arbitration
    Get-Mailbox -Monitoring

    At this point reboot the server and verify that IIS and other roles are working correctly.
    Finally, you can uninstall Exchange 2013 from Add/Remove Programs or PowerShell with below command:

    Setup /Mode:Uninstall /iacceptexchangeserverlicenseterms

    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Allen Wang
    TechNet Community Support

    Thursday, April 14, 2016 7:44 AM
    Moderator
  • Hi, we have an intranet domain where an Exchange 2013 was installed for testing purposes. This is no more used and can be deactivated. Now I need to format the server where Exchange was installed. I'd like to know if there are preliminary actions to perform... do I need to uninstall exchange? How? What about active directory? I don't want to affect existings domain users or other AD things. Thank you

    Remove Exchange gracefully with add/remove programs only. Its the only supported method. 

    If any mailboxes  or connectors etc... remain on that server, Exchange will flag it. 


    Blog:    Twitter:   

    Wednesday, April 13, 2016 11:03 AM
    Moderator

All replies

  • Hi,

    You can directly remove your exchange from  control Panel -> Add/Remove Programs

    If you come across any issues you can follow the below article

    http://kx.cloudingenium.com/microsoft/servers/exchange/exchange-2013/exchange-2013-completely-remove-settings-active-directory/

    Note: As said by Andy removing from adsiedit is not supported.

    Regards,

    Praveen

    ----------------------------------------------------------------------

    Remember to mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you Check out my latest blog posts on Exchange 2016 @ Techrid.com


    Wednesday, April 13, 2016 10:31 AM
  • Hi,

    You can directly remove your exchange from  control Panel -> Add/Remove Programs

    If you come across any issues you can follow the below article

    http://kx.cloudingenium.com/microsoft/servers/exchange/exchange-2013/exchange-2013-completely-remove-settings-active-directory/

    Regards,

    Praveen

    ----------------------------------------------------------------------

    Remember to mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you Check out my latest blog posts on Exchange 2016 @ Techrid.com

    Removing via adsiedit is not supported and should not be suggested.

    Blog:    Twitter:   

    Wednesday, April 13, 2016 11:02 AM
    Moderator
  • Hi, we have an intranet domain where an Exchange 2013 was installed for testing purposes. This is no more used and can be deactivated. Now I need to format the server where Exchange was installed. I'd like to know if there are preliminary actions to perform... do I need to uninstall exchange? How? What about active directory? I don't want to affect existings domain users or other AD things. Thank you

    Remove Exchange gracefully with add/remove programs only. Its the only supported method. 

    If any mailboxes  or connectors etc... remain on that server, Exchange will flag it. 


    Blog:    Twitter:   

    Wednesday, April 13, 2016 11:03 AM
    Moderator
  • Hi,

    We need remove all mailbox (include arbitration mailbox and monitoring mailbox), then remove all mailbox database before uninstall Exchange server.

    Please follow below steps to uninstall Exchange server:
    1. Disable mailbox:

    Get-User | Disable-Mailbox
    Get-Mailbox -Arbitration | Disable-Mailbox -Arbitration -DisableLastArbitrationMailboxAllowed
    Get-Mailbox -Monitoring | Disable-Mailbox

    2. Remove restore mailbox for disconnected or soft-deleted mailbox:

    Get-Mailbox | Get-MailboxStatistics | Where {$_.DisconnectReason -eq “Disabled” } | |foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState Disabled}
    Get-Mailbox | Get-MailboxStatistics | where {$_.DisconnectReason -eq “SoftDeleted”} |foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}

    3. Remove database:

    Get-MailboxDatabase | Remove-MailboxDatabase

    4. Remove partner application configuration:

    Get-PartnerApplication| Remove-PartnerApplication

    5. Verify nothing is left:
    Get-Mailbox
    Get-Mailbox -Arbitration
    Get-Mailbox -Monitoring

    At this point reboot the server and verify that IIS and other roles are working correctly.
    Finally, you can uninstall Exchange 2013 from Add/Remove Programs or PowerShell with below command:

    Setup /Mode:Uninstall /iacceptexchangeserverlicenseterms

    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Allen Wang
    TechNet Community Support

    Thursday, April 14, 2016 7:44 AM
    Moderator
  • Thanks for the info!

    For step 1 , disabling mailboxes, I also had to disable our public folder:

    Get-Mailbox -Database '<Mail Database ID>' -PublicFolder | Disable-Mailbox -PublicFolder

    Sunday, March 26, 2017 3:54 PM
  • Hi,

    We need remove all mailbox (include arbitration mailbox and monitoring mailbox), then remove all mailbox database before uninstall Exchange server.

    Please follow below steps to uninstall Exchange server:
    1. Disable mailbox:

    Get-User | Disable-Mailbox
    Get-Mailbox -Arbitration | Disable-Mailbox -Arbitration -DisableLastArbitrationMailboxAllowed
    Get-Mailbox -Monitoring | Disable-Mailbox

    2. Remove restore mailbox for disconnected or soft-deleted mailbox:

    Get-Mailbox | Get-MailboxStatistics | Where {$_.DisconnectReason -eq “Disabled” } | |foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState Disabled}
    Get-Mailbox | Get-MailboxStatistics | where {$_.DisconnectReason -eq “SoftDeleted”} |foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}

    3. Remove database:

    Get-MailboxDatabase | Remove-MailboxDatabase

    4. Remove partner application configuration:

    Get-PartnerApplication| Remove-PartnerApplication

    5. Verify nothing is left:
    Get-Mailbox
    Get-Mailbox -Arbitration
    Get-Mailbox -Monitoring

    At this point reboot the server and verify that IIS and other roles are working correctly.
    Finally, you can uninstall Exchange 2013 from Add/Remove Programs or PowerShell with below command:

    Setup /Mode:Uninstall /iacceptexchangeserverlicenseterms

    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Allen Wang
    TechNet Community Support


    • Proposed as answer by Travelerthx Tuesday, May 30, 2017 6:24 PM
    • Unproposed as answer by Travelerthx Tuesday, May 30, 2017 8:08 PM
    Tuesday, May 30, 2017 6:24 PM
  • This helped me remove Exchange 2013.

    One thing to note, on step 2., line1, there are duplicate pipelines.

    “Disabled” } | |foreach

    • Edited by srazvan Friday, January 5, 2018 5:43 PM
    Friday, January 5, 2018 5:42 PM
  • Great write up!

    Thank you!

    Wednesday, July 18, 2018 9:53 PM