Exchange 2013 Upgrade/Uninstall fails while uninstall Search Foundation for Exchange

This post is to explain one of the common problem experienced during upgrade / uninstall of 

Exchange Server 2013. The Process fails while uninstall Search foundation for Exchange. 

  

Exchange Server 2013 Setup logs show the error below.

"Error occurred while uninstalling Search Foundation for Exchange.System.Exception:

Cannot determine the product name registry subkey, neither the 'RegistryProductName'

application setting nor the 'CERES_REGISTRY_PRODUCT_NAME' environment variable was set."

catch
{
$deleteErrorMsg = "Failure
cleaning up SearchFoundation Data folder. - " + $dataFolderPath + " - " + $_.Exception.Message;
Write-ExchangeSetupLog -Error $deleteErrorMsg;
}
as run: "Error occurred while uninstalling Search Foundation for Exchange.System.Exception:

Cannot determine the product name registry subkey, neither the 'RegistryProductName' application

setting nor the 'CERES_REGISTRY_PRODUCT_NAME' environment variable was set
at
Microsoft.Ceres.Common.Utils.Registry.RegistryUtils.get_ProductKeyName()

in n:\src\search\foundation\Common\Utils\Registry\RegistryUtils.
at
Microsoft.Ceres.Exchange.PostSetup.DeploymentManager.DeleteDataDirectory()
at
Microsoft.Ceres.Exchange.PostSetup.DeploymentManager.Uninstall(String installDirectory, String logFile) at

CallSite.Target(Closure,CallSite,Type,Object,Object )"- System.Management.Automation.RuntimeException:

Error occurred while uninstalling Search Foundation for Exchange.System.Exception: Cannot determine

the product name registry subkey, neither the 'RegistryProductName' application setting nor

the 'CERES_REGISTRY_PRODUCT_NAME' environment variable was set
at
Microsoft.Ceres.Common.Utils.Registry.RegistryUtils.get_ProductKeyName() in n:\src\search\foundation\Common\Utils\Registry\RegistryUtils.
at
Microsoft.Ceres.Exchange.PostSetup.DeploymentManager.DeleteDataDirectory()
at
Microsoft.Ceres.Exchange.PostSetup.DeploymentManager.Uninstall(String installDirectory, String logFile)
at CallSite.Target(Closure , CallSite , Type , Object , Object )
at
System.Management.Automation.PowerShell.EndInvoke(IAsyncResult asyncResult)
at
Microsoft.Exchange.Configuration.MonadDataProvider.MonadPipelineProxy.

.ClosePipeline(MonadAsyncResult asyncResult)

 

Details:

--------- 

After installation of Exchange 2013 Installer process set the CERES_REGISTRY_PRODUCT_NAME 

variable under user variables. when it fails to set this variable Exchange server 2013 cannot connect

to search engine and other issues may be experienced .

Error will occur if Environment variable CERES_REGISTRY_PRODUCT_NAME is not properly

set prior to launch installer or Uninstaller. To list all the environment variables use :

 

Get-Childitem env: ( Or Dir Evn: )

To display values of the CERES_REGISTRY_PRODUCT_NAME environment variable, it is

missing because of which Exchange uninstall process is failed.

For Example :

 

 

To resolve the issue , run following command to set the values for CERES_REGISTRY_PRODUCT_NAME

$env:CERES_REGISTRY_PRODUCT_NAME = "Search Foundation for Exchange" .

 

Once this is done Upgrade /uninstall Exchange Server 2013 should complete.   

 

Manju

Comments

  • Anonymous
    April 08, 2014
    Thank you for this post. It helps very much while resolving issues occures in upgrading from exchange 2013 CU1 to SP1
  • Anonymous
    April 14, 2014
    These articles describe how to troubleshoot Fast Search issues with Exchange Server 2013. When you think
  • Anonymous
    October 16, 2015
    This works fine, but I had to leave my powershell session open while I ran uninstall or else it "forgot" the $env setting.