Wednesday, July 15, 2015

Exchange 2010 SP3 /mRecoverServer (the short version)

We "have" a HA Exchange 2010 setup.  The 2 x CAS/HT servers are Hyper-V and WLB.  The 2 x MBX/HT servers are clustered physical boxes.  At one point Outlook client connections just started dropping from Exchange seemingly at random.  After trying tons of things I found that after I rebooted one of the hosts it would calm down for a while.  Eventually I turned off the box and everything has been great since.  I have no clue why it was doing that.  I believe that something got borked inside Exchange on that box.

After having that box off for a while it was decided that I start testing Exchange 2013 on it.  I went to uninstall Exchange (once I was out of a critical work period) and it gave me all kinds of errors and would not uninstall gracefully.  I ran a setup uninstall command and that got me further but eventually failed.  That box was certainly in a failed state.

I knew that I couldn't just format c: and put 2013 on it and go on with my life as a higher up suggested to me.  I had to gracefully uninstall Exchange off that box.  (Well I didn't have to, but I *DID NOT* want to launch ADSIedit at all!)  I started doing research and found the recoverserver switch.  I really didn't want to format c: either and spend a day installing Windows and getting patches and doing all that fun stuff.  I figured that I could just say maybe delete a Microsoft directory under Program Files and recover from there.  Here is my trials and tribulations of a failed Exchange 2010 SP3 uninstall and the attempts to use recoverserver to get it back installed again:

GUI install certainly didn't work.  We all knew that would be the case.  So after a bit of searching I found the recoverserver command (which failed):

I also need to point out that I had problems running the install because I had all the services set to Disabled.  The installer needs to be able to start services or it will fail out.  

Error #1:

Setup /M:RecoverServer /TargetDir "E:\Program Files\Microsoft\Exchange Server\V14" /donotstartTransport

Error text:
The parameters specified are either missing additional required parameters or are not valid together.
To list the available command-line parameters, type Setup /?



I couldn't spot the subtle error.  Finally figured out the switch TargetDir needs a : between it and the target.

Working command:
Setup /m:RecoverServer /donotstartTransport /TargetDir:"E:\Program Files\Microsoft\Exchange Server\V14"

Error #2:

Error text:
The previous installation path could not be found in the registry. Only disaster recovery mode is available.
The previously installed version could not be determined from the registry. Only disaster recovery mode is available.

Exchange Server setup encountered an error.



Fix:
looked at registry path HKLM\software\Microsoft\Exchange server\V14
- deleted Key "Midfilecopy" and "Setup" under V14
DID NOT REBOOT THE SERVER

Source: https://social.technet.microsoft.com/Forums/exchange/en-US/209604ce-2f74-41b1-b0eb-c5ad19ece305/failed-to-upgrad-exchange-2010-sp1-the-previous-installation-path-could-not-be-found-in-the?forum=exchange2010



Error #3:




Error text:
Setup previously failed while performing the action "BuildToBuildUpgrade". You can't resume setup by performing the action "DisasterRecovery".

Exchange Server setup encountered an error.

Fix:
Under the registry Key that corresponds to the "installed" roles:
\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v14\<"installed" roles>

Delete Value "Action" with Data of "Install"
(If you want to skip past Error #4 then do the following while you're here:
Delete Value "Watermark" with Data of "Powershellsomethingsomethingsomething")

Source: http://baudlabs.com/setup-previously-failed-while-performing-the-action-install-error-during-exchange-2010-sp2-upgrade/

Error #4:

Error text:
A Setup failure previously occurred while installing the HubTransport role. Either run Setup again for just this role, or remove the role using Control Panel.

Fix:
You know that place you were just in?
Under the registry Key that corresponds to the "installed" roles:
\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v14\<"installed" roles>
Delete Value "Watermark" with Data of "Powershellsomethingsomethingsomething"

Source: https://myrefspot.wordpress.com/2013/01/10/exchange-2010-server-recovery-failed-on-hub-transport-role/

Error #5:

Error text:
Installing product C:\Temp\Exchange SP3 Install\exchangeserver.msi failed.
Fatal error during installation. Error code is 1603.

Fix:
I copied the install files over from a central location.  In the Updates folder under the extracted SP3 setup files at one point someone (probably me) placed the CU2 update in that directory.  It took me forever to figure this one out.  I deleted the file and the 1603 error went away.  It's always a good idea to just redownload and reextract the SP3 file to the machine you are working on in case some idiot messes up your source files directory.

Error #6:

Error text:
[ERROR] The virtual directory 'PowerShell-Proxy' already exists under 'FQDN.Server.Name/Default Web Site'.

Fix:
Went into IIS and deleted the PowerShell-Proxy virtual directory.

Had to remove the setup Keys and Values from under the registry as above. 
Had to reboot after this step since it got far enough into the install. 

Error #7:

Error text:
The following error was generated when "$error.Clear();
$wevtutil= join-path (join-path $env:SystemRoot system32) wevtutil.exe;
$manifestPath = [System.IO.Path]::Combine($RoleInstallPath, "Scripts\TSCrimsonManifest.man");
Start-SetupProcess -Name:"$wevtutil" -Args:"im `"$manifestPath`" "
        " was run: "Process execution failed with exit code 87.".
 
Fix:
Delete the registry Key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Microsoft-Exchange-Troubleshooters/Operational

Had to remove the PowerShell-Proxy virtual directory.
Had to remove the setup Keys and Values from under the registry as above. 
Had to reboot after this step since it got far enough into the install. 

Source: https://social.technet.microsoft.com/Forums/exchange/en-US/17619f0e-bd05-4e40-9f60-49fc1bbb1602/problems-installing-mailbox-role-on-exchange-server-2010-sp3?forum=exchange2010

Summary:

In the registry:
\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v14\
Delete Keys: "Midfilecopy" and "Setup"
Under the 'server roles' Keys delete any Values that are "Action" and "Watermark"

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\
Delete Key: Microsoft-Exchange-Troubleshooters/Operational

In IIS:
Delete the PowerShell-Proxy virtual directory

Make sure your install files are good and do not have any extra stuff included in the folders.

Run an administrative command prompt then start setup from within the extracted SP3 folder making note of the subtleties of the command syntax:
Setup /m:RecoverServer /donotstartTransport /TargetDir:"E:\Program Files\Microsoft\Exchange Server\V14"