If you have a borked Exchange Server, Microsoft has a wonderful re-install option that lets you setup a new server with the same options to replace it with. It is so easy and effective, it kind of makes up for the Exchange 2010 SP3 install that destroyed one of my production servers.

On my server, SP3 passed all the pre-installation checks and started installing happily, but after removing all the exchange program files it crashed with a:

An error occurred during the installation of assembly ‘Microsoft.VC90.ATL,version=”9.0.30729.4959″

Leaving half the folders in the Exchange folder gone, all the exchange services disabled and unable to start and an event log full of errors. Trying to re-install yields

The Exchange Server is in an inconsistent state. Only disaster recovery mode is available. Please use Setup /m:RecoverServer to recover this Exchange server.

If I knew then what I know now, I would have spun up a new VM and installed Exchange with the /m:RecoverServer option right away. But I’m always a little worried about unfamiliar Microsoft commands since they usually mean Googling a bunch of new errors. In it’s current state, running setup with that option gave me an error about not being able to read the install directory from the registry so I spent the next 8 hours trying without sucess to restore and merge in a backup.

Here is the easy way to fix it: (from this Microsoft article)

  1. Load up a new server (hopefully you’re using VMs – if not, backup your exchange folder and reload your existing server).
  2. Reset the old server’s computer account in your domain (right-click on server in Active Directory Users & Computers -> Reset account), give your new server the same computer name as the old server and join it to the domain.
  3. Install all the updates and service packs for windows
  4. Install all the Exchange pre-requisites (Exchange 2010 prerequisites)
  5. Run setup /m:RecoverServer from an administrator command prompt
    If you didn’t install exchange in the default directory, you’ll also need the /TargetDir argument ie:
    setup /m:RecoverServer /TargetDir: “D:\Exchange”
  6. The install will read all the configuration information from Active Directory and you’ll end up with a fresh version of your old server with all it’s previous configuration.
  7. Copy over your mailbox and public folder databases into their old locations and mount them up – back in business!

This is so slick and painless, it’s almost worth doing as routine maintenance or whenever any errors pop up on your server.