Using the /recoverserver switch

Exchange 2007′s setup program includes the ability to reinstall the Exchange binaries on a failed server. I had to use this today to replace a server VM that was mangled by a problem with our SAN controller; through no fault of anyone except a certain large SAN company, the VM was corrupt and couldn’t be restored. I rebuilt the base OS image, gave it the same machine name, and fired up setup /m:recoverserver. That seemed to work OK, reinstalling the hub transport and mailbox roles. Then I got an unexpected error:

Client Access Role ……………………. FAILED

The AD Object for virtual directory ‘IIS://EXCHANGE/W3SVC/1/ROOT/Microsoft-Server-ActiveSync’ on ‘EXCHANGE’ could not be created. This may be happening because it already exists in Active Directory. Remove the object from Active Directory, then re-create it.

I couldn’t find any documentation on how to fix this. That’s an awfully generic error message. However, I eventually found the suspect object living in the configuration NC of my AD: cn=services, cn=Microsoft Exchange, cn=orgName, cn=Administrative Groups, cn=Servers, cn=serverName, cn=Protocols, cn=HTTP. So, I removed it. All done? Not quite.

See, once you run with /m:recoverserver, the setup code writes a flag in each role (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange\v8.0\roleName) that says “I’m in disaster recovery mode”. As long as that flag is present, you can’t install or remove server roles, so I couldn’t just run exsetup /m:install /r:clientaccess like you’d think. First, I removed the Action value under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange\v8.0\ClientAccessRole. Next, I uninstalled the CAS role (which wasn’t really there anyway!), then I re-installed the CAS role. However, Exchange setup still thought the CAS role was installed, so it wouldn’t install it. I tried adjusting MSExchCurrentServerRoles for the server object, but I don’t think Exchange likes a value of “0″. Subsequent reinstalls complained that the Exchange Servers USG was missing. Rather than continue to tinker, I ended up removing the AD org object and reinstalling from scratch. I think the original virtual directory error is a bug, and I’m going to report it as such.

Update: this is now logged as bug 176356.

About these ads


Filed under UC&C

4 responses to “Using the /recoverserver switch

  1. Jorge Mtz

    I just want to understand this, you removed the object form AD, the IIS obj, then you try the recoverserver, right? but that didn’t work out, so yo have to reinstall all again.. but when you do that, did you do it again with recoverserver? or was a new exchange server?? If I delete the IIS obj and then try with recoverserver, would it work?

  2. First I removed the IIS object that was highlighted in the original message and attempted to use /m:recoverserver. That didn’t work. I then tried several other tweaks, none of which worked. Eventually I removed the Exchange organization object from the AD configuration NC and reinstalled from scratch (not using /m:recoverserver). That did the trick.
    It’s *supposed* to work when you remove the IIS object and use /m:recoverserver, but– at least in my case– it doesn’t.

  3. Charles

    In a similar issue I was testing the recoveryserver option and Exchange hung on the error: Setup previously failed while performing the action “DisasterRecovery”. You cannot resume setup by performing the action “Install”. I could not uninstall the Hub Transport Role. I could not reinstall it to remove it. By clearing the action flag registry entry I was able to remove Exchange 2007. I removed the registry entry and then ran exsetup /mode:install /r:Hubtransport. This failed, but I was then able to remove Exchange via add/remove programs. THANK YOU.

  4. BTW this bug is fixed in Exchange 2007 build 647.