How to properly remove Exchange 2007/2010 from SBS 2008/2011 after migration to Office 365

Back to Blog

How to properly remove Exchange 2007/2010 from SBS 2008/2011 after migration to Office 365

Most small businesses that were invested in the Small Business Server (SBS) platform are migrating to Office 365. This means they no longer need to keep their on-premises Exchange Server. However, there is a proper way to remove the Exchange services from the SBS server before you dismantle it for good.

  • Exchange should be removed before AD/DNS: The uninstall procedure needs to be done in advance of removing Active Directory roles from the SBS server;
  • Windows Server editions: Note that this procedure is also valid for removing the last legacy Exchange 2007 / 2010 Server from Windows Standard / Enterprise / Datacenter editions;
  • Hybrid/Remote Move Migrations: if you had performed a Remote Move migration from SBS 2011 or Exchange 2010, then you need to follow a slightly different procedure, to ensure that Directory synchronization and the hybrid relationship is properly retired before uninstall. Therefore, only proceed with the below if you are positive that you do not have a hybrid connection, and/or Directory Synchronization in place. Alternatively, you may consider keeping a free Exchange server on-premises to maintain the hybrid connection.

Prepare Exchange for Uninstall

You will need to run several PowerShell commands to help prepare your server for uninstall. Warning: this assumes all data has been migrated to Office 365, and you have no further need of Exchange data / services on-premises. Proceed at your own risk.

remove-exch-1

Open the Exchange Management Shell as Administrator, and run the following PoSH snippets in this order for SBS 2008/2011 or Exchange 2007/2010, answering prompts for confirmation in the affirmative for all (A).

#Remove default Public folders
Get-PublicFolder "\" -Recurse -ResultSize:Unlimited | 
Remove-PublicFolder -Recurse -ErrorAction:SilentlyContinue

#Remove system Public folders
Get-PublicFolder "\Non_Ipm_Subtree" -Recurse -ResultSize:Unlimited | 
Remove-PublicFolder -Recurse -ErrorAction:SilentlyContinue

#Remove Offline Address Book
Get-OfflineAddressBook | Remove-OfflineAddressBook

#Remove send connectors
Get-SendConnector | Remove-SendConnector

#Remove Public Folder database (SBS 2011/Exchange 2010 Only)
Get-PublicFolderDatabase | Remove-PublicFolderDatabase

#Remove arbitration mailboxes (SBS 2011/Exchange 2010 Only)
Get-Mailbox -Arbitration | Disable-Mailbox -Arbitration -DisableLastArbitrationMailboxAllowed

#Remove mailboxes
Get-Mailbox | Disable-Mailbox

Uninstall Exchange

Now you are ready to run the uninstaller. From an elevated command prompt, navigate to the directory “C:\Program Files\Microsoft\Exchange Server\Bin” or “C:\Program Files\Microsoft\Exchange Server\v14\Bin”  and run:

setup.com /mode:uninstall

remove-exch-2

That should be it. After Exchange is fully removed, you can proceed with the rest of the decom process, which will be covered in an upcoming post.

Comments (82)

  • Jan Reply

    Excellent article, worked like a charm, thanks!

    January 27, 2017 at 1:28 pm
  • Seef Reply

    Great post! Thanks!

    February 1, 2017 at 6:28 am
  • Alain Arnold Reply

    Can i install Azure AD Connect after remove my Exchange 2007 Server?

    Regards,
    Alain

    March 14, 2017 at 5:07 pm
    • Alexander Reply

      Alain, yes you can, however note that Microsoft would like you to have an Exchange server for management purposes (usually a 2013 or 2016 server). Technically, it will work even without, but it will change how you manage certain attributes of the cloud accounts (they must be managed on-premises). This article provides more background on this dilemma, as well as some options for dealing with it.

      March 15, 2017 at 12:57 pm
  • Rick Reply

    Hello again!

    I know there’s no mention of SBS2003 above, but just in case anyone has that, Step 13 here is the best that I’ve found to do it (it’s completely different):
    https://demazter.wordpress.com/2011/02/24/migrate-small-business-server-2003-to-small-business-server-2011

    BTW, you’re removing Exchange super-early in the process, even before replication. That makes sense to me (theoretically, none of the Exchange attributes in AD would migrate, though it’s often said that Exchange 2003 leaves a lot behind when uninstalled), but at least for SBS2003, what I’m finding is advice to do it very late in the process. In some cases it makes sense, since people will be running Exchange on the new server (like at the previous link), but SuperGumby (ahem) below is not talking about that case only. In that non-hybrid case, it’s unclear why uninstalling late (as long as, like you say, it’s before the roles transfer) is important.
    https://social.technet.microsoft.com/Forums/en-US/6f555a40-3a71-4434-9a7d-0ac83705c7ba/what-point-to-uninstall-exchange-from-sbs-2003

    Thanks

    May 7, 2017 at 8:48 pm
    • Alexander Reply

      I don’t run across too many SBS 2003 boxes anymore–that was out of support now three years ago! But it doesn’t mean there won’t be some out there still. That’s a great resource. I don’t know why they suggest later timing to be honest. If you have the new Exchange server installed and all the mailboxes & public folder data migrated, it should not matter when you actually remove the role, as long as it is done before you demote the server. Since most people fear Exchange migrations the most, I usually try to encourage them to get it done first, before everything else. From there it is smooth sailing.

      May 7, 2017 at 9:57 pm
  • Jim Thurman Reply

    Excellent Tutorial – Thank you for putting this together! I was able to complete the process on my SBS2011/Exch2010 box after following your tutorial on doing a hard Cut Over to O365 Exchange. One minor thing that happened to me and a quick Google search resolved was that I received the following error message while in the elevated command prompt for Mailbox Role Checks, Client Access Role Checks, Hub Transport Role Checks and the Organization Checks:

    PrerequisitesFailed
    Error:
    Setup cannot continue with the upgrade because the ‘DataCollectorSvc’ () process (ID: 8824) has open files. Close the process and restart Setup.

    My Google search led me to open Task Manager > Processes > Show Processes From All Users > DataCollectorSvc (right click and End Process)

    Worked like a champ after that!

    Thanks again – and keep up the great work – us “little IT guys” really appreciate all you do!

    June 7, 2017 at 11:23 am
  • Dan Reply

    Excellent article, worked like a charm, but before running all these steps you must delete all pending or failed MailboxImportRequest and MailboxExportRequest
    Thanks

    July 31, 2017 at 7:46 am
  • Manuel Reply

    Fantastic post.
    Thanks

    September 12, 2017 at 4:46 am
  • Mario Reply

    I think there is a missing step before you can uninstall the exchange on SBS 2008.
    https://technet.microsoft.com/en-us/library/dd728003(v=ws.10).aspx
    Can you confirm?

    September 27, 2017 at 4:32 pm
    • Alex Reply

      Hm… I have never added a registry key in order to remove Exchange. I just follow the exact procedure I detailed here, and it has worked every time. Let me know if you have a different experience to share!

      September 27, 2017 at 5:02 pm
      • Mario Reply

        Hi, Alex, I have followed your instructions and got to the point after all mailboxes and public folders were removed it asked me for the DVD to continue with the removal. As I had no DVD with me at that time I had to cancel the setup. So now the installation of the exchange is still in place. What do you recommend for the next step?

        September 27, 2017 at 5:24 pm
        • Alex Reply

          If you do not have any install media, and there is no other way to continue the uninstall from the command line or Control panel, you could always whack it from ADSIedit directly. Usually used as last resort. I don’t have a go-to reference for this, but if you search for remove exchange manually adsiedit, or similar, you will likely find some good results. Be sure to have AD, files and so forth off the SBS server also, since you’ll probably be putting this box to rest forcefully. Assuming everything is already live on a new replacement system, such as Server Essentials or Standard 2016, then this shouldn’t be too scary of a procedure. It would be similar to one scenario I had, where we migrated off a dying SBS box in the nick of time, before it bit the dust for good (failed RAID rebuild)–we just deleted the objects from AD, cleaned up references in DNS, etc. Everything else was done from migration standpoint not two days prior–no joke!

          September 27, 2017 at 8:55 pm
          • Mario

            Yes, I do have the media just didn’t have it at the time of removal. I have used the cmd prompts as you did and did not try to remove it yet from the programs and features. I will try to do that and let you know the outcome. Just wanted to know if you have anything to say before I do that.
            This server is still production server after we moved email to exchange online so I want to be careful.

            September 27, 2017 at 9:15 pm
          • Alex

            If you have install media, definitely go that route–it may ask for it, and that is fine. Like I said, the forceful removal is like a last resort usually. I haven’t had to resort to it except in extreme cases. In another case, I had an SBS sever basically tell me to eff off–I wish I could find that screenshot. It was just garbledy-gook in a little pop-up prompt, when attempting to remove. All I could do was click OK. Bizarre. But yeah, those are like one in a thousand. Most of the time, this procedure I have laid out is all that is required.

            September 27, 2017 at 10:44 pm
  • Jim Reply

    We have recently added a separate Exchange 2013 server to our network. I have been having some issues removing the 2010 install from our SBS 2011 box. Your description says it is for after you migrate to Office 365. Can these steps be using to uninstall ours even though we still have a local Exchange box?

    October 3, 2017 at 8:37 pm
    • Alex Reply

      Yes, it is the same procedure. Before you remove the old server, just be sure that all mailboxes and any mailbox move requests (for completed migrations) are cleared from the old server. The steps listed here should take care of the rest.

      October 3, 2017 at 9:00 pm
      • Alex Rourke Reply

        I don’t think this is true. If you run those “Get” commands, it pulls information from both the current server and any other Exchange servers in the domain. Presumably, the remove commands would do the same.

        October 10, 2017 at 1:20 pm
        • Alex Reply

          Let me be sure you understand when to use this procedure. When you have migrated 100% of mail and public folder data to Office 365, then there is no need for on-premises mailbox databases any longer. Even if you are keeping a hybrid server on-premises, but you want to remove your old Exchange server (where mail data was stored), then this procedure is totally fine to run, since the hybrid server is purely a management UI at that point, and not responsible for any other functions which are handled by Exchange Online.

          October 11, 2017 at 3:03 pm
          • Alex Rourke

            I understand that. I am in that situation right now: I installed an Exchange 2016 hybrid server, migrated everything to Office 365, and am now looking to decommission our SBS 2011 server.

            I still don’t think you’re right about this. For instance, if I run the command to get send connectors, it pulls send connectors from all servers, including those that connect the on-premise 2016 server to O365. In a hybrid environment where the hybrid Exchange server is being used for SMTP relay from internal applications and printers, these are critical. This is true of arbitration mailboxes as well, which also exist on the hybrid server and would be deleted with your commands.

            Thanks for the great guides, they’ve been very helpful to me during this migration process!

            October 17, 2017 at 2:24 pm
          • Alex

            Ah, I see. Yes, you need to specify which server you “get” the connectors from, with the -Server switch. On another note, it is also possible to configure relay directly in your tenant, and they hybrid server is purely for management at that point.

            October 18, 2017 at 2:17 pm
        • Alex Reply

          Also if you have mailbox/public folder data on-premises you need to keep, all you have to do is specify which server you want to run the command against so “Get-X” would be followed by “-Server [ServerName]”–that would be safe to use when you need to preserve on-premises data on other servers.

          October 11, 2017 at 3:05 pm
  • Richard Stelma Reply

    I’m trying to decommission Exchange after migrating to Office 365 on SBS 2011 using this article. I want to migrate AD to a new metal box running Server 2016 and then demote and remove the SBS DC from the domain.

    I have the Exchange Management Shell open as Administrator. I’m typing in the commands as you have them listed and the only thing I’m getting is this:

    PS C:\Windows\system32> Get-Publicfolder “\” -Recurse -ResultSize:Unlimited | Re
    move-PublicFolder -Recurse -ErrorAction:SilentlyContinue

    The term ‘Get-Publicfolder’ is not recognized as the name of a cmdlet, function….

    What am I missing here? Thank you for your reply.

    Richard

    October 31, 2017 at 7:14 pm
    • Alex Reply

      1. Make sure you are running the Exchange PowerShell console and not just PowerShell (without the Exchange module loaded).
      2. Check your execution policy and ensure also that you have appropriate permissions (e.g. Organization)
      3. Check credential manager, clear it out of any stored credentials, log off and back on as the Organization administrator
      4. Triple check you run the Exchange Shell, right click, run as admin.

      November 1, 2017 at 9:39 pm
  • C Blue Reply

    Thanks SO much! Have struggled for while with removing Exchange from a number of SBS 2011 (and 2008 in a couple instances) and this just straight WORKED! Saw some errors where it said things were running, but it gave process number and it was EASY to kill those processes and re-execute, till it just worked, all the way through, to the end.

    November 8, 2017 at 5:17 pm
  • Jamie Reply

    Great article. What if were already migrated to Office 365 and are using DirSync. Once we uninstall Exchange, what will happen to all the synced accounts on O365?

    November 15, 2017 at 2:44 pm
    • Alex Reply

      You will want to be careful with that. When you remove the “last” or “only” Exchange server in the environment, it will remove Exchange attributes from all the accounts, which can cause some issues (missing alias addresses, sign-in problems, etc.). It is not recommended to remove the last Exchange Server from the domain if you have Azure AD Connect in place. Therefore, do it at your own risk, or install a free hybrid server first, and THEN decom the old Exchange server. There is another method you can use to backup / export the attributes, and re-import them. Be sure the AD sync tool is in staging mode/disabled while this is happening. Here is an article describing that process.

      November 16, 2017 at 11:50 am
  • Oswald J Reply

    I have completed three cut-over migration from online exchange server to Microsoft Exchange Plan 1 during the last three years. The last one, just completed last week and used your article at https://www.itpromentor.com/365-cutover/. This is by far the best and easiest instructions I’ve ever come across. Thanks a bunch for clear instructions.
    I just want to add some important information which I think not included. Step 5.
    You definitely need to add a SRV record to the local domain in order to solve the certificate issue and autodiscover issues. Following solutions worked for me all three occasions:
    1. Open the DNS manager on one of the Domain Controllers.
    2. Expand the management tree and go to Internal Domain’s Forward Lookup Zone. Click on it, and remove the existing A records for autodiscover.domain.local in the zone.
    3. Then, right-click the Zone name and select Other New Records.
    4. Select Service Location (SRV) from the list.
    5. Enter the following settings:
    Domain: mydomain.local
    Service: _autodiscover
    Protocol: _tcp
    Priority: 0
    Weight: 0
    Port number: 443
    Host offering this service: autodiscover.mydomain.com

    Once the SRV record is added to the internal DNS zone, Outlook and other autodiscover clients that attempt to configure themselves with a domain.local SMTP address will work properly without the Certificate errors.

    December 5, 2017 at 6:51 pm
  • Oswald Reply

    This is a life saver! Thank you Alex. Just completed this on my old SBS2008 successfully.

    December 7, 2017 at 7:45 am
  • David de la Nougerede Reply

    I get the following error when i try to run Get-PublicFolderDatabase | Remove-PublicFolderDatabase

    Public folder database “Public Folder Database 1669168154” is the default public folder database for the following mail
    box database(s):
    Mailbox Database 2012102712
    . Before deleting the public folder database, assign a new default public folder database to the mailbox database(s).
    + CategoryInfo : InvalidOperation: (Public Folder Database 1669168154:ADObjectId) [Remove-PublicFolderDat
    abase], InvalidOperationException
    + FullyQualifiedErrorId : 788DD46B,Microsoft.Exchange.Management.SystemConfigurationTasks.RemovePublicFolderDataba
    se

    December 11, 2017 at 5:03 am
  • ASB Reply

    All went smoothly. But one thing needs to be remove as well is: routing group connector with Get-RoutingGroupConnector | Remove-RoutingGroupConnector command.

    January 3, 2018 at 6:41 am
  • Franklin Reply

    Thank you for doing this post. Very helpfull!

    January 30, 2018 at 11:28 am
  • Rodrigo Correia Reply

    Hello
    I Need one question

    I have SBS2011
    will not this procedure delete my SBS user account?

    I need to keep all domain users

    January 31, 2018 at 12:50 pm
    • Alex Reply

      Removing Exchange impacts Exchange items only (mailboxes, contacts, public folders, etc.) and does not affect user accounts in AD other than removing their mail attributes.

      February 11, 2018 at 7:11 pm
  • DAG Reply

    Hello Alex. Great stuff. I have done AD removals and such in past, but I have not decom’ed an Ex200X server. Until now.

    I have migrated all users email from SBS 2008 (Ex2007) via Hybrid Ex 2013 method you excellently put together in another article. I have to move files and such next, and then plan to remove Ex 2007 and then decom the SBS 2008 server by turning up a 2016 AD server for the domain.

    Above, you mention in the Hybrid/Remote Move Migrations: “if you had performed a Remote Move migration from SBS 2011 or Exchange 2010, then you need to follow a slightly different procedure, to ensure that Directory synchronization and the hybrid relationship is properly retired before uninstall. Therefore, only proceed with the below if you are positive that you do not have a hybrid connection, and/or Directory Synchronization in place. Alternatively, you may consider keeping a free Exchange server on-premises to maintain the hybrid connection.”

    My query is I want to keep the AD Azure connection, and the free Hybrid Ex 2013 instance in place.
    – Do I leave AD Azure and Ex 2013 in place while I decom the old EX 2007 server and remove its files to another server?
    – Or do I need to disable AD Azure first? I was looking over your over migration guides, and did not really see this, but I could be mistaken.
    – If I am leaving the hybrid Ex 2013 server in place, do I have to break the hybrid connections or just leave it alone?

    Having asked that, when its time to move the AD roles to a new 2016 Std server, do I keep AD Azure running or stop it for the migration?

    Many, many, many thanks!!!

    DAG

    February 12, 2018 at 8:51 am
    • Alex Reply

      You can leave the Azure AD Connect and 2013 Exchange in place–as long as there is an Exchange server in the org (in your case a 2013), then you can safely remove 2007 assuming there is no more important data left on it. That other disclaimer I have in there is if you are removing the last Exchange server from the org–you have to retire Azure AD Connect & hybrid in that case. But you’re okay to keep it exactly as is and just run the uninstall procedure.

      February 12, 2018 at 6:02 pm
      • DAG Reply

        Alex. just to clarify again – I have Azure AD in place and the 2013 Hybrid server. I want to delete Exchange 2007 from an SBS 2008 server. All mailboxes from the Ex 2007 server are migrated, gone or not needed. I will eventually be moving the user data and AD to a new 2016 server later this year, so the SBS 2008 server still needs to be in place for awhile.

        Can I leave Azure AD and the Ex 2013 Hybrid server in place without any changes and then properly remove Ex 2007 from the SBS 2008 server? No other got-cha’s? I am keeping the 2013 hybrid server and AD (for management and SMTP relay’s.)

        My worry is removing the Ex2007 from the domain will also delete the user’s AD information from AD and then break Azure AD and delete cloud email accounts (very bad!!!!)

        Thanks again.

        March 19, 2018 at 1:03 pm
        • Alex Reply

          Properly removing 2007 will not remove any information from AD about Exchange-related properties on users, etc., so long as there is a 2013 server present in the environment. It should remove the Exchange server, not the Exchange attributes (this will only happen when removing the “last”/only Exchange server in an environment).

          March 20, 2018 at 9:19 am
  • DAG Reply

    Alex, a million thanks yous!!

    DAG

    February 13, 2018 at 7:53 am
  • Thomas Reply

    Thanks for the great article Alex! I’m running into an issue running the commands. I am running in the Exchange Management shell as administrator. I have tried to run the commands multiple times but I’m not having success. I have tried two different admin accounts with no luck either. When I run the commands it just sits there. I run the first one like this:

    Get-PublicFolder “\” -Recurse -ResultSize:Unlimited |
    Remove-PublicFolder -Recurse -ErrorAction:SilentlyContinue

    I hit enter and that’s when it just sits there. Is it supposed to take some time before I see the prompts to confirm after the command is run or am I supposed to run the commands in succession and then I will see the prompts? Thanks again for this article!

    February 28, 2018 at 4:50 pm
    • Alex Reply

      Hm, well it can take a bit of time depending on the environment, but it should just go overall–now, I have seen if you are copy/pasting sometimes certain characters like quotations are messed up; not sure if that is happening in this case (typically though that generates an error, whereas this sounds like it is just not moving forward).

      March 3, 2018 at 6:21 pm
  • Dennis Reply

    After Exchange 2010 Removal from SBS 2011 my customer experienced loss of access to Remote Web Workplace. Accessing the page would produce a spinning loading screen in IE. Found repeated errors in the Aplication Event LOg
    Source: Microsoft-Windows-IIS-W3SVC-WP
    Event ID: 2280
    Description: The Module DLL C:\Program Files\Microsoft\Exchange Server\V14\Bin\kerbauth.dll failed to load.

    This site had a fix:
    https://blogs.msdn.microsoft.com/gaurav/2013/10/23/the-module-dll-kerbauth-dll-failed-to-load-the-data-is-the-error-the-module-dll-cprogram-filesmicrosoftexchange-serverv14binkerbauth-dll-failed-to-load-the-data-is-the-error/
    1. Open ApplicationHost.config file at this path C:\Windows\System32\inetsrv\config
    2. Find the entry for kerbauth.dll like following

    3. Change the path for this dll as per the latest location of the Exchange Server installation files.

    Someone posted that if you recently removed Exchange 2010, and was not planning on reinstalling it, simply removing this line and restarting the IIS server services: W3SVC (World Wide Web Publishing Service) which also restarts Remote Desktop Gateway service.

    This seems to have resolved my issue with loss of RWW after removing Exchange 2010 from SBS 2011..

    June 18, 2018 at 9:45 pm
  • Ron Petersen Reply

    If you are cutting and pasting the two line commands, I found I had to combine them into a one line command to get them to work. If you get >> (two greater than signs), you have not entered the command correctly. If the pipe (|) is the last character of the line, you will get the >> indicating an incomplete command. You will get no progress, no confirmation wording, etc. It will sit with >> forever.

    June 27, 2018 at 12:47 pm
  • Raghav Kapoor Reply

    Hi Alex,
    I followed the process provided above to remove exchange from SBS 2008. Infact, I am using a test SBS environment on Hyper-V to make sure things work in test env.

    However, I am getting errors when running PS commands.
    First one fails when trying to remove PublicFolderDatabase. it says “Cannot find an available public folder database. Possibly bec its a test environment, and I haven’t configured a public database.
    So, I ignored that error with public folder, and ran the uninistall via CMD, which I was assuming wont work. And the uninstall fails saying “Service ‘MSExchangeSA’ failed to reach status “Stopped” on this server.
    I see in services and “MS EXchange System Attendant” service is in Status “Stopping”.

    Could you please provide any advise on this?
    Thanks,
    Raghav

    July 26, 2018 at 7:17 am
    • Alex Reply

      Reboot, and then google it if that doesn’t do the trick. (This is like the universal IT guidance for every problem. Ever.)

      July 28, 2018 at 6:43 pm
  • Lance Reply

    After completing these steps on my SBS 2011 server Active Directory was broken. No users, including Administrator, were listed. Users lost connectivity to the network resources. I am currently trying to figure out what to do.

    August 20, 2018 at 12:05 pm
    • Alex Reply

      Sounds like you must have done something wrong, or had another issue that happened to correspond to this timeframe–many have followed this process without issue. Refer to backup if you must, and let us know how it goes.

      August 21, 2018 at 3:25 pm
    • Dariusz Reply

      Lance, have you got any update? I will be doing this shortly, and knowing my luck, will face this issue.

      July 5, 2019 at 1:23 am
      • Alex Reply

        If you follow the steps and take proper precaution you should not have an issue. Use the built-in BPA tools and DCDIAG to verify health. Verify backups, and proceed. Again, this is when you are completely free of all dependencies on Exchange. No more mailboxes, no more Directory Sync/Azure AD Connect. You are ready to be done with your last Exchange server. Then this is very low risk and cannot do anything to AD accounts except remove mailbox attributes.

        July 6, 2019 at 3:58 pm
  • Ian Murphy Reply

    If this is the last exchange server and you get an error saying that there are Public folder replicas then the easiest way to get rid of them is to
    – dismount the public folder DB
    – remove the public folder db file from the folder where its located
    – remove the files from the log directory associated with the public folder db
    – remount the public folder db and say ok when it gives a warning.

    continue with the instructions above

    November 13, 2018 at 7:29 am
  • Marc Reply

    Hi everyone,

    uninstallation worked properly now.
    I also needed to fix some kerbauth.dll errors by modifing applicationHost.config and fixi the Remote Desktop Gateway by deleting web.config in system32\RpcProxy.

    But there are still some errors I’m worrying about.

    Possibly someone can help:

    1. Problem is, that I get every full half an hour following errors six times with minor differences:

    Protocoll: Microsoft-Windows-PowerShell/Operativ
    Source: PowerShell (Microsoft-Windows-PowerShell)
    Keywords: PowerShell-Remotingtransport
    Error ID: 32784
    Type: Error
    Message:
    Runspace ID: 2f2d5551-d9ef-435d-a683-746489633a84 Pipeline ID: 00000000-0000-0000-0000-000000000000. WSMan reported an error with the error code: -2144108269.
      Error message: The following error occurred while connecting to the remote server: The WinRM client has sent a request to the remote queue management service and received a response stating that the requested HTTP URL is not available. This message is typically returned by an HTTP server that does not support the WS-Management protocol. For more information, see the about_Remote_Troubleshooting help topic.
      StackTrace:

    2. Error I get after every reboot of the Remote Desktop Gateway:
    Protocol: Microsoft-Windows-TerminalServices-Gateway/Operational
    Source: TerminalServices-Gateway
    Keywords: (16777216)
    Errorid: 402
    Type: Warning
    Message: Failed to register the Remote Desktop Gateway service with the service connection point.

    Is there anyone who can help with that errors?

    Thanks in advance.

    Cheers

    November 20, 2018 at 1:55 am
  • Stuart Katz Reply

    @Ian Murphy

    Thank you for the tip. I followed your suggestion and this fixed with the Public Folder replica error I was getting.
    I’m still having another issue. I’m running the command: Get-Mailbox | Disable-Mailbox and receive this error message:

    Sending data to a remote command failed with the following error message: The WinRM client sent a request to the remote WS-Management service and got a response saying the request was too large. For more information, see the about_Remote_Troubleshooting Help topic.

    Any idea?

    March 2, 2019 at 3:15 pm
  • David Chamberlain-Jones Reply

    The RAID where our Exchange Mailstores was located has given up the ghost and is unrecoverable so we’ve done a hard pst migration to O365. I now need to remove Exchange from SBS 2011 and have used your article many times before successfully, however in this instance apart from getting errors on some of the scripts above because it can’t find the drive the stores were on I’m getting an error I’ve not encountered before when running the uninstall:

    C:\Program Files\Microsoft\Exchange Server\V14\Bin>setup.com /mode:uninstall
    Welcome to Microsoft Exchange Server 2010 Unattended Setup
    Preparing Exchange Setup
    The LPVersioning file has an invalid value. Please check the Exchange Log for
    more information.
    Exchange Server setup encountered an error.
    C:\Program Files\Microsoft\Exchange Server\V14\Bin>

    Do you have any tips on what might be causing this and how I can get round it? I’ll quite happily resort to ADSIEDIT for hacking out if necessary but would prefer a cleaner solution :)

    April 29, 2019 at 5:41 am
  • DAG Reply

    Hi Alex. I have posted here before, and you have been an immense help.

    I finally migrated and retired an SBS 2008 server and put it out of its misery. I migrated emails to O365 some time ago, and am still using Azure AD connect to keep the on-prem Ex 2013 and cloud accounts in sync as I pike the password updates and do not mind using ADSI to edit accounts for email creation, etc.

    The one thing I just wanted to bring out is that when I was downing the Ex 2007 shutdown, I ran into issues with the “Get-PublicFolder “\Non_Ipm_Subtree” -Recurse -ResultSize:Unlimited |
    Remove-PublicFolder -Recurse -ErrorAction:SilentlyContinue”. In my case, uninstall was throwing an error that it could no be removed by the Ex 2007 because it kept saying it was created with a future version of Exchange (which is the hybrid Ex instance and is being kept on site). I had to research and find a fix whereby you had to go into the ADSIedit and delete the Public folder manually, and then the uninstall went on without any further issues. Here is link that helped me: https://cloudiffic.com/object-is-read-only-because-it-was

    Hope this helps anyone if the run into this.

    DAG

    July 8, 2019 at 9:53 am
  • Angus Reply

    Is it possible to uninstall Exchange Server 2007 without removing the public folder database ? We have disabled exchange services and removed the data stores to a backup location and don’t have space to copy them back and remount them. The data is all now safe in exchange online and not needed.

    August 14, 2019 at 8:12 am
    • Alex Reply

      There is always adsi edit (not supported but effective)

      August 14, 2019 at 1:17 pm
      • Angus CLAYDON Reply

        Hi Alex
        Thanks for that. It turned out the public folder database was still on C: we only moved the mailbox.edb
        eventually after a couple of hiccups all the scripts you published ran through and ‘exchange server setup operation completed successfully’.

        August 15, 2019 at 5:12 am
  • Szilard Krachun Reply

    Dear Alex,

    unfortunately I found your post too late. I unistalled the DC role from my Windows 2008 SBS server – without uninstalling Exchange from the server. Is there a proper way in this situation to remove Exchange from the server? Exchange was migrated to O365, so the current one doesn’t matter much.

    Thanks for your help:

    Sz.

    March 26, 2020 at 2:06 pm
    • Alex Reply

      While it is not recommended/supported by MSFT per se, you can always try whacking it from ADSI edit, the old fashioned way.

      March 27, 2020 at 10:41 am
      • Szilard Krachun Reply

        Yes, as I thought. Thx for your answer. :)

        March 27, 2020 at 12:18 pm
  • Jay Reply

    We are decommissioning SBS 2011. A few months ago we disabled all Exchange services apart from MS Exchange AD Topology and we moved to Exchange Online. We are now running out of space on the system drive (2-3 weeks before moving to the new server) and ideally we would like to move the mailbox store from the system drive where it currently is located. When I run EMC I’m getting ‘Failed to connect to an Exchange Server in the current site’ message. Ideally, we would like to keep all the services disabled. I was wondering if it is safe to simply move the mailbox store to a different location or alternatively what would be the minimail number of Exchange services we would need to start to run the commands from your article and also to Remove Service Connection Point (SCP)?

    Thank you!

    July 30, 2020 at 6:03 pm
    • Alex Reply

      I recommend you turn them all back on and then upgrade your on-prem Exchange instance by installing a member server with Exchange 2016 (so you can get the free hybrid activation). Move to that (do you need any data anymore on-prem? I would question that if you believe the answer is yes–all data should be moved to cloud). Having completed the upgrade, you can completely remove Exchange services from SBS.

      July 31, 2020 at 11:20 am
      • Jay Reply

        Thank you very much for your reply.

        Sorry, I didn’t make myself clear. All data is already in the cloud. We don’t need neither Exchange nor mailboxes from the on premise server. All we want is to free up some space.

        August 1, 2020 at 9:19 am
        • Alex Reply

          Oh yes then you can completely remove any mailbox data, and you don’t need to move anything from the old mailbox store to the new.

          August 2, 2020 at 3:15 pm
  • Steve Reply

    Thank you for the post. It helped greatly. My server is SBS 2008. However, I am a little confused by the following cmd,

    “Get-PublicFolder “\Non_Ipm_Subtree” -Recurse -ResultSize:Unlimited”

    It outputted a long list of entries. In the “Name” column there is only one entry labeled “NON_IPM_SUBTREE”, but in the “Parent Path” column all the entries are labeled “\NON_IPM_SUBTREE”.

    Do I remove just the one with the name “NON_IPM_SUBTREE” or all the entries? It is asking for an identity. Not sure what to put there.

    Also, with the cmd to remove the public folder database, you stated only for SBS 2011. Is it not needed to remove the public folder database for SBS 2008 server? Just confirming.

    August 25, 2020 at 2:37 pm
    • Alex Reply

      You would run the entire string at once–see how there is a PIPE (|) between the Get and the Remove cmdlet? So it will get all the results and pipe it in to remove, thereby deleting everything.

      August 25, 2020 at 4:00 pm
    • Steve Reply

      Thanks for clarifying that. I tend to make things more difficult than they are.

      August 26, 2020 at 9:11 pm
  • Steve Reply

    One last question. I wanted to check if you have posted the remaining steps for decommissioning?

    August 26, 2020 at 9:25 pm
  • Steve Reply

    Hi Alex,
    Our current environment is an Exchange 2013 Server in Hybrid mode with all of our mailboxes and public folder on O365. We recently installed an E2019 server to the org (followed your guide “How to upgrade a Legacy Hybrid Exchange Server to 2016”, but used 2019). I would now like to remove the E2013 server from the org, and have the E2019 be in Hybrid mode with O365. How would these instructions differ for E2013 removal as compared to 2007/2010, if any?

    September 16, 2020 at 11:19 am
    • Alex Reply

      Hm, been a while since I had to do it but probably very little difference.

      September 17, 2020 at 11:07 am
  • Joe Reply

    Can these steps be used on a standalone version of Exchange 2010?

    Thanks

    Joe

    September 30, 2020 at 1:36 pm
    • Alex Reply

      Should work, yes. Be sure you have zero dependency on the Exchange server, and no Azure AD Connect in place. Then you’re good.

      September 30, 2020 at 5:11 pm
  • TankAdmin Reply

    Hi Alex,

    I think if you remove send connector will automatically remove from the hybrid exchange 2016.
    Do you have a command list to check any mail connectivity to old exchange before decomissioned?
    TA

    October 5, 2020 at 4:52 am
  • Raj Reply

    Hi,
    We have Exchange 2010 servers on which we ran Hybrid but now we want to introduce Exchange 2016 servers in the environment & want to run hybrid wizard on Exchange 2016 Servers. This article looks very good & has detailed information but I still don’t understand the following:-

    Though we changed the pointing of all virtual directories internally & externally to new Exchange 2016 server, made changes in send connectors & also created receive connectors on new Exchange 2016 servers, How we can first remove the Exchange 2010 Hybrid Server from the environment before running the Hybrid Configuration Wizard on new Exchange 2016 Servers?

    March 31, 2021 at 3:10 pm
    • Alex Reply

      Not sure it makes a big difference when to run the HCW. I mean all that does is create/update the hybrid configuration object. You can do that before decom of 2010 with no impact, as far as I know. Also not sure there would be much impact the other way, but I always tended to update the object (it will choose to use the newer server by default when you do) then decom the old system after I knew there was no reference to it any more.

      March 31, 2021 at 4:30 pm
  • PeterMcL Reply

    Hi, many thanks for this guide, I went through the 3 Parts, AD migration to new server, exchange and then got to the remove global catalogue and thought I would do some checks on the new server. Argh no mailboxes and no public folder content. The mail boxes were disconnected and I have reconnected all bar one which is not listed. The public folder was replicated some time ago and the replication from the new server removed. I have used a utility Systools to look at the edb files and both the missing mailbox is there and the publicfolders are in the public database but I see no way to get them assessible. I have a backup of the databases but am not convinced the issue is with the db files any idears appreciated. Current plan is to pay up for the utility move all the public folders to a mailbox and then use outlook to move them back to public folders, there is only a few thousand!

    July 10, 2021 at 2:00 pm
    • Alex Reply

      As stated in this article, the procedures are only for removing Exchange after all data has been migrated to Office 365 Exchange Online (so that you no longer need any mailbox data on-prem). If you followed this, and still had data on an Exchange server in your on-premises org that you wanted to keep on-prem, then you would have to restore your Exchange environment from backup.

      July 14, 2021 at 1:19 pm
      • Peter McLaughlin Reply

        Ah sorry I thought it matched my removing a SBS after migrating to a Win2012 with exchange. In the end I recovered the public folders database, reconnected the mailboxes to the users except for one that seemed to have gone but turned up later despite the forced clean-ups as I had recovered this users mailbox from backup it flushed out a bunch of old X400 address and some old addresses (the user had got married so a name changed) Interestingly the old addresses where in the global address book (according to outlook) but not in exchange, couldn’t see them in the user using Adsiedit either, ended up putting the phantom email addresses into exchange, no errors about already existing, leaving for a while forcing update to GAB and then deleting the email addresses forcing updates and the the old address and the X400 all got removed , hurrah!

        July 15, 2021 at 4:23 am
  • Anthony P Reply

    If I am just decom’ing an Exchange 2010 server while an exchange2016 Hybrid server still exists in the environment will that change the process in this documentation? Specifically the power shell remove commands will they be specific to the server they are being run from and not for example be removing all the send connectors in the environment that are on the Exchange2016 server thats staying.

    August 4, 2022 at 2:36 pm

Leave a Reply

Back to Blog

Helping IT Consultants Succeed in the Microsoft Cloud

Have a Question? Contact me today.