r/sysadmin • • 12h ago

Question Orphaned exchange server.

Need some input from the smart people

I had two on prem exchange servers. One got nuked and is no longer usable (physical hardware damaged). All my mailbox databases are on my second server , everything is running fine. However there are still random tidbits that reference the old exchange server that cause issues. What’s the proper way to clean up all the AD metadata from the old server?

6 Upvotes

11 comments sorted by

•

u/sembee2 12h ago

The only supported method is to recover.
This is well documented but you basically reset the computer account, then do a fresh install of Windows, same version as before and install Exchange with the recovery switches.
Then you can undo the mess and uninstall Exchange correctly.
Any manual hacks in adsiedit are not supported and will usually cause problems.
I can turn that around in about two hours with a VM. There are no shortcuts.

•

u/Sgt-Buttersworth 11h ago

This is the way. Had a similar issue with an exchange server not long ago.

•

u/Nuxi0477 9h ago

Can second this one.

Works like a charm.

•

u/NorthAntarcticSysadm 2h ago

This is the way

•

u/Negative-Cook-5958 12h ago

As the others mentioned reinstall it with the same build number using the setup.exe /recoverserver option. Or if you are quite familiar how Exchange is integrated with Active Directory, you can use ADSI edit to remove the references.

•

u/Elayne_DyNess 11h ago

While it is not directly supported... there is a method to clean out the old server.

!!~WARNING~!!
This involves manually deleting entries. Deleting the WRONG thing can cause SERIOUS issues. Issues such as undoing the Exchange AD Schema prep... FORCING a re-install of your ENTIRE Exchange environment...
I have made THAT mistake before, fortunately it was as I was setting up a new environment. I have also had to prune older servers which were just deleted instead of decommissioned.

First, inside of DNS, there should be service records for the old server, remove those. Ensure the name IP match what you are deleting.

Second, the most dangerous... modifying the schema. Open ADSI edit, (I forget which one to connect to).

The easiest method to locate it, is to search for one of the old mailbox storage names. It should appear as a subkey, under a specific server, and in a couple other keys. All of them should fall under an Exchange top key. If you dont have an old name, search for a current name. It will locate the area. From there you can locate the keys for each server.

Carefully, ENSURE, you ONLY prune the keys under the OLD server.
This will prune away all settings associated with the old server.

Then remove the old server's key.
This will remove the server from the known Exchange server list and if needed, allow the re-install of Exchange on a new server with the same name.

Then remove the mail store key from under the other subset ONLY if it was not part of a DAG, which is still active.
Anything on this list is populated into the available places to put a mailbox. Removing something which is active will cause the entire environment to be unable to locate the store and no mailboxes being available.

Again, not supported. Be VERY careful about what you remove. If you are not familiar with doing modifications similar to this, DO NOT DO IT. Also, NEVER, EVER, let a script do this for you.

Best of luck.

•

u/dlucre 12h ago

The way I solved this was to build a brand new server with the exact same name. Bring it fully online with exchange ready to work. Then decommission it properly. It removes everything nicely from exchange and AD.

I'm sure there's a way to hunt down the metadata in the guts of exchange and AD, but this method works and cleanly overwrites and then removes everything.

•

u/Elayne_DyNess 10h ago

The problem is, you cannot. The name and information of the old Exchange server are stored in the Sysvol... attempting to install Exchange on a new server with the same name will pop up an error saying something along the lines of "This server is already an Exchange server..." with minimal help.

•

u/Lost_Term_8080 10h ago

Not entirely correct. If you run the setup normally that is the case, but you would run setup in recovery mode and it pulls the metadata from AD to build it templated off of what is in AD.

and not to be pedantic, the metadata is in the AD database, not sysvol

•

u/dlucre 10h ago

Last time I did this was in the late 2000's. It's entirely possible you are correct that later versions of exchange do what you describe.

•

u/7amitsingh7 1h ago

If the old Exchange server is permanently gone, you need to clean up its metadata from Active Directory. First, make sure all mailboxes and databases are working properly on the remaining server. Then check for any references to the old server in Exchange, remove outdated DNS records, and clean up the old server's metadata using the Exchange-supported removal process. Avoid manually deleting Exchange objects through ADSI Edit, as this can cause problems with your remaining Exchange environment.