When attempting to install Exchange Server 2013 setup may fail with an error message:

Setup encountered a problem while validating the state of Active Directory:

Couldn’t find the Enterprise Organization container. See the Exchange setup log for more information on this error.

For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.AdInitErrorRule.aspx

Reviewing the Exchange setup log (C:\ExchangeSetupLogs\ExchangeSetup.log) shows similar messages.

[11/12/2014 06:36:10.0207] [1] Failed [Rule:AdInitErrorRule] [Message:Setup encountered a problem while validating the state of Active Directory: Couldn’t find the Enterprise Organization container. See the Exchange setup log for more information on this error.]

[11/12/2014 06:36:10.0223] [1] [RECOMENDED] Setup will prepare the organization for Exchange 2013 by using ‘Setup /PrepareAD’. No Exchange 2007 server roles have been detected in this topology. After this operation, you will not be able to install any Exchange 2007 servers.

[11/12/2014 06:36:10.0223] [1] [RECOMENDED] Setup will prepare the organization for Exchange 2013 by using ‘Setup /PrepareAD’. No Exchange 2010 server roles have been detected in this topology. After this operation, you will not be able to install any Exchange 2010 servers.

[11/12/2014 06:36:10.0223] [1] [REQUIRED] Setup encountered a problem while validating the state of Active Directory: Couldn’t find the Enterprise Organization container. See the Exchange setup log for more information on this error.

[11/12/2014 06:36:10.0223] [1] Help URL: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.AdInitErrorRule.aspx

[11/12/2014 06:36:10.0238] [1] Ending processing test-SetupPrerequisites

This problem can occur when installing Exchange Server 2013 into an Active Directory forest that previously contained an Exchange organization.

I have reproduced this error condition in a test lab environment after encountering it at a customer site:

An on-premises Exchange Server 2007 organization existed

The business migrated to Office 365

The on-premises Exchange server was cleanly and completely uninstalled

Under these conditions setup of Exchange Server 2013 CU6 will fail. The problem may also occur with pre-existing Exchange Server 2010 organizations, or with other builds of Exchange 2013, but I have not tested all of those scenarios.

The solution is to re-run setup for the previous version of Exchange to prepare Active Directory again. There is no need to fully install a server, simply preparing Active Directory should be enough.

For example, with Exchange Server 2007 (SP3) the following command is run:

C:\Admin\Ex2007sp3> setup /preparead /on:"First Organization" 1 C : \ Admin \ Ex2007sp3 > setup / preparead / on : "First Organization"

(The /on: switch is short for /OrganizatioName, and “First Organization” is the name I gave my organization. You should use the appropriate organization name for your environment, which can’t be changed later.)

Let’s walk through the scenario in more detail. An Exchange Server 2007 organization exists, with the usual containers visible in ADSIEdit.

Exchange 2007 is cleanly removed from the environment.

After removal, the Microsoft Exchange System Objects container is still visible in Active Directory Users & Computers (select View -> Advanced Features to see it), with the Exchange Install Domain Servers group still present.

The Microsoft Exchange Security Groups container is also still visible in Active Directory Users & Computers, with the Exchange Trusted Subsystem group the only group left behind (all other groups normally seen here have been removed by the uninstall process).

The organization is no longer visible in ADSIEdit.

The simplest execution of Exchange Server 2013 setup is to prepare the schema. The command line is:

C:\Admin\ex2013cu6> setup /prepareschema /IacceptExchangeServerLicenseTerms 1 C : \ Admin \ ex2013cu6 > setup / prepareschema / IacceptExchangeServerLicenseTerms

This fails with the error message.

If you search the internet for information on this error “Couldn’t find the Enterprise Organization container” you will encounter some advice about manually deleting certain containers and objects from Active Directory. In my testing none of these actions helps to resolve the issue, and in some cases make things worse.

However, re-running Exchange 2007 (SP3) setup as mentioned earlier to prepare Active Directory resolves the issue and allows Exchange Server 2013 setup to proceed as normal.