0

TenantOrganizationConfig Required When Preparing Active Directory

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 /PrepareSchema

Error - A hybrid deployment with Office 365 has been detected. Please ensure that you are running setup with the /TenantOrganizationConfig switch

A similar issue will occur if you specify only /PrepareAD

setup.exe /IAcceptExchangeServerLicenseTerms /PrepareAD

Same Issue - Error - A hybrid deployment with Office 365 has been detected. Please ensure that you are running setup with the /TenantOrganizationConfig switch

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.

  1. Generate tenant XML config file
  2. 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

Generating Tenant Organisation Config XML File

For reference, the contents of the XML are show below for reference.

For Reference - The Tenant Organisation Config XML File

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 /PrepareAD /TenantOrganizationConfig C:\Source\MyTenantOrganizationConfig.xml

PrepareAD Running Setup With the Previously Downloaded Tenant Config File

The operation starts, and does the necessary work to perform the /PrepareSchema and /PrepareAD steps.

PrepareAD Setup Completed With the Previously Downloaded Tenant Config File I

Now that Active Directory has been prepared, we can continue to install the CU on the individual servers.

Active Directory Has Been Successfully Prepared. Now Able To Install CU Onto Exchagne Servers

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.

Invalid Option On PrepareSchema

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 /PrepareAD /TenantOrganizationConfig MyTenantOrganizationConfig.xml

You need to specify the location of the XML file.

Setup.exe /IAcceptExchangeServerLicenseTerms /PrepareAD /TenantOrganizationConfig C:\Source\MyTenantOrganizationConfig.xml

This one was “interesting”.  There was an error due to an unexpected hash mismatch.

Error - OrganizationConfigHash property appears to be from a different Exchange Online tenant

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.

Cheers,
Rhoderick

Rhoderick Milne [MSFT]

Leave a Reply

Your email address will not be published. Required fields are marked *