Error when you run /PrepareSchema

Error when you run /PrepareSchema

22 January 2020 0 By angelusadeuszabulus

Error installing a new exchange server in coexistence with another Exchange server in hybrid mode / Office 365

 

A hybrid deployment with Office 365 has been detected. Please make sure you are running the installer with / TenantOrganizationConfig

 

Many companies use Exchange 2010 in hybrid mode with Office 365, but with the end of life of Exchange 2010, it’s time to migrate to a newer version.

When preparing Active Directory for Exchange 2016 using the / PrepareSchema switch, the following error is displayed:

 

1
2
3
4
5
6
7
8
9
A hybrid deployment with Office 365 has been detected. Please ensure that you are running setup with the /TenantOrganizationConfig switch. To use the TenantOrganizationConfig switch you must first connect to your Exchange Online tenant via PowerShell and execute the

following command: "Get-OrganizationConfig | Export-Clixml -Path MyTenantOrganizationConfig.XML". Once the XML file has been generated, run setup with the TenantOrganizationConfig switch as follows "/TenantOrganizationConfig MyTenantOrganizationConfig.XML".

If you continue to see this this message then it indicates that either the XML file specified is corrupt, or you are attempting to upgrade your on-premises Exchange installation to a build that isn't compatible with the Exchange version of your Office 365 tenant. Your Office

365 tenant must be upgraded to a compatible version of Exchange before upgrading your on-premises Exchange installation. For more information, see: http://go.microsoft.com/fwlink/?LinkId=262888

For more information, visit: <a href="http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.DidTenantSettingCreatedAnException.aspx">http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.DidTenantSettingCreatedAnException.aspx</a>

 

To be able to prepare your Active Directory in a coexistence scenario with Exchange Online, you must export your organization’s configuration to an XML file.

We will connect to our Office 365 tenant with the following script:

 

1
2
3
4
5
6
7
Set-ExecutionPolicy RemoteSigned

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session -DisableNameChecking

 

Once connected to the Office 365 tenant we will launch the following command:

 

1
Get-OrganizationConfig | Export-Clixml -Path C:\chader\MyTenantOrganizationConfig.XML

 

This retrieves the organization configuration from Exchange Online and exports it to an XML file.

We are going to prepare Active Directory with the following command:

 

1
.\Setup.EXE /PrepareAD /TenantOrganizationConfig C:\chader\MyTenantOrganizationConfig.xml /IAcceptExchangeServerLicenseTerms

 

“/PrepareSchema” cannot be used with the “/TenantOrganizationConfig” parameter, this is why we use / PrepareAD.

You can now continue your exchange installation.