When running /PrepareSchema in an Exchange organisation with an existing Exchange Hybrid deployment you may run into an error which states:
"A hybrid deployment with Office 365 has been detected. Please ensure that you are running setup with the /TenantOrganizationConfig switch"
This is shown below:
setup.exe /IAcceptExchangeServerLicenseTerms_DiagnosticDataON /PrepareSchema
A similar issue will occur if you specify only /PrepareAD
setup.exe /IAcceptExchangeServerLicenseTerms_DiagnosticDataON /PrepareAD
Note that the /TenantOrganizationConfig switch was NOT added, and this caused the command to fail.
The fix is straightforward, so let's take a look.
Solution
There are two parts to the solution.
- Generate tenant XML config file
- Use /PrepareAD along with the tenant XML config file
First up, to generate the tenant XML config file, we need to connect to Exchange Online using PowerShell. Once connected and authenticated, we will save the Exchange Online organisation's details to a local XML file. Note that the present working directory is C:\Source so the file is saved there as a full path was not entered.
Get-OrganizationConfig | Export-Clixml -Path MyTenantOrganizationConfig.XML
For reference, the contents of the XML are show below:
Now that we have the config file, we can use it as part of the preparation process. This is where the second trick comes in.
We can not run /PrepareSchema on its own. This is because we need to provide the /TenantOrganizationConfig but this parameter does not exist with /PrepareSchema. Since it only exists with /PrepareAD we will use that, and it will automatically run /PrepareSchema if the account has the correct permissions (Schema Admin).
The below was executed from an elevated CMD prompt
Setup.exe /IAcceptExchangeServerLicenseTerms_DiagnosticDataON /PrepareAD /TenantOrganizationConfig C:\Source\MyTenantOrganizationConfig.xml
The operation starts, and does the necessary work to perform the /PrepareSchema and /PrepareAD steps.
Now that Active Directory has been prepared, we can continue to install the CU on the individual servers.
For more reading on the operations on preparing AD please review Docs.
Setup Gone Bad
The below are some common issues that I see in the field.As noted above the TenantorganizationConfig switch is not available on the /PrepareSchema command. Should you want to try it, the below error will be your prize.
It is also not valid for /PrepareDomain. You will get the below error.The parameter 'tenantorganizationconfig' is not valid for current operation 'PrepareDomain'.
Setup checks failed: Invalid command line arguments.
Note that you need to specify the location of the XML file. Simply running the sample command as listed in the error description will fail.
For reference the sample command is:
Setup.exe /IAcceptExchangeServerLicenseTerms_DiagnosticDataON /PrepareAD /TenantOrganizationConfig MyTenantOrganizationConfig.xml
You need to specify the location of the XML file.
Setup.exe /IAcceptExchangeServerLicenseTerms_DiagnosticDataON /PrepareAD /TenantOrganizationConfig C:\Source\MyTenantOrganizationConfig.xml
This one was “interesting”. There was an error due to an unexpected hash mismatch.
To align Exchange Online with the on-premises deployment we re-ran the HCW in a change window.
Then we were able to run the /PrepareAD command.
For reference the error log text is shown below:
[10/08/2020 01:50:40.0153] [1] Failed [Rule:DidTenantSettingCreatedAnException] [Message:The OrganizationConfigHash property appears to be from a different Exchange Online tenant than the one you have a hybrid deployment with.]
[10/08/2020 01:50:40.0153] [1] [RECOMENDED] Setup will prepare the organization for Exchange Server 2016 by using 'Setup /PrepareAD'. No Exchange Server 2013 roles have been detected in this topology. After this operation, you will not be able to install any Exchange Server 2013 roles.
[10/08/2020 01:50:40.0165] [1] [REQUIRED] The OrganizationConfigHash property appears to be from a different Exchange Online tenant than the one you have a hybrid deployment with.
Update
Since the command line options for Exchange setup changed, the sample commands in this post were updated so that /IAcceptExchangeServerLicenseTerms was replaced with IAcceptExchangeServerLicenseTerms_DiagnosticDataON
For more details, please see this post on the setup changes introduced in Exchange 2016 CU22 and Exchange 2019 CU11.
Cheers,
Rhoderick
Excellent work here! Thank you.
Could you please update the switch /IAcceptExchangeServerLicenseTerms_DiagnosticDataOFF
Thanks for the post. I have a question about that.
The switch /TenantOrganizationConfig is a must or it´s not necesary if I don´t get an error while runing the command?.
Thanks !
Hey,
Necessary if you have existing Exchange Hybrid - if no Hybrid then not required.
Cheers,
Rhoderick
After TenantOrganizationConfig is used to prepare the A.D. domain and the Office365 tenant, can you still use the old version of Exchange?
After the tenant is prepared, will it still work with older exchange, until new exchange has been properly installed and configured?
I can't find this information anywhere....
Exchange schema updates etc. have always been cumulative, so when you prepare AD for Exchange 2019 then the 2016 version continues to work.
Normal support policy applies though, and you will be blocked from running Exchange 2019 setup if Exchange 2010 is still present in the org.
Also, do not want to deploy new servers and leave them unconfigured, that can and will lead to certificate pop up issues etc.
Cheers,
Rhoderick
Hi Rhoderick
We are running Exchange 2013 (i know) in full classic Hybrid mode and last weekend we were getting ready for upgrading to Exchange 2019. We used Exchange 2019 CU12 to extend the schema and we never did see any warning / error about running in Hybrid mode. All steps including schema, ad prep and domain prep went fine.
So is Exchange 2019 CU12 setup not recognizing Exchange 2013 Hybrid Mode?
thank you