Symptoms
When you try to set up Microsoft Exchange Server 2019 Cumulative Update 10 (CU10) or Microsoft Exchange Server 2016 Cumulative Update 21 (CU21), Setup fails at the "PrepareAD" step and returns the following error message:
System.NullReferenceException: Object reference not set to an instance of an object.
Cause
Setup fails if it cannot find or access the CN=Computers.<domain>.<com> container.
Workaround
If the Computers container was renamed to some other name, use Active Directory Users and Computers to revert the container name to "Computers."
If the Computers container was deleted or you cannot rename the original Computers container, use the following steps to create a dummy Computers container to enable Setup to continue:
-
Open ADSI Edit (Adsiedit.msc).
-
Right-click ADSI Edit, and select Connect to.
-
In the Connection Settings window in the Name field, make sure that Default naming context is selected on the drop-down list, and then select OK.
-
Expand Default naming context [<domain>], right-click DC=<domain>,DC=com, and then select New > Object.
-
In the Create Object window in the class list, select container, and then select Next.
-
In the Value field, enter Computers, and then select Next.
-
Select Finish.
-
Force Active Directory (AD) replication.
-
Resume or start Exchange Setup again.