Exchange ServerTroubleshooting

Exchange PrepareSchema and PrepareAD errors: permissions, schema master and AD versions

Fix Exchange /PrepareSchema and /PrepareAD failures: missing Schema Admins or Enterprise Admins rights, wrong site or domain, unfinished replication and stale AD entries. Then verify AD versions.

Exchange Server SE and 2019 can't be installed or updated until Active Directory is prepared, and /PrepareSchema and /PrepareAD fail fast when the account, the computer's location or replication isn't right. In this post I'll match the common errors to their causes, give you the commands that fix them and show how to verify the AD versions afterwards.

Errors this guide fixes

  • The Active Directory schema isn't up-to-date, and this user account isn't a member of the 'Schema Admins' and/or 'Enterprise Admins' groups.Exchange setup readiness checks
  • Setup encountered a problem while validating the state of Active DirectoryExchangeSetup.log+1 more guide
  • setup can't create them because the local computer isn't in the same domain and site as the schema masterExchangeSetup.log
  • points to an invalid DN or a deleted object. Remove the entry, and then rerun the task.Exchange setup / PrepareAD
How this guide is organised: Symptoms → Why it happens → How to fix it → Verify the fix → Prevent it next timeFlow diagram of the article's sections in reading order: 1. Symptoms. 2. Why it happens. 3. How to fix it (5 steps: Check who and where you are; Fix the token; Run the steps from the schema master's domain and site; Remove stale otherWellKnownObjects entries; Still failing?). 4. Verify the fix. 5. Prevent it next time. Toolbox: ExchangeSetup.log, nltest, /PrepareAD, /PrepareSchema, /PrepareAllDomains.1Symptoms2Why it happens3How to fix it4Verify the fix5Prevent it nexttime1Check who andwhere you are2Fix the token3Run the steps fromthe schema maste…4Remove staleotherWellKnownO…5Still failing?TOOLBOXExchangeSetup.lognltest/PrepareAD/PrepareSchema/PrepareAllDomainsHow this guide is organised: Symptoms → Why it happens → How to fix it → Verify the fix → Prevent it next timeFlow diagram of the article's sections in reading order: 1. Symptoms. 2. Why it happens. 3. How to fix it (5 steps: Check who and where you are; Fix the token; Run the steps from the schema master's domain and site; Remove stale otherWellKnownObjects entries; Still failing?). 4. Verify the fix. 5. Prevent it next time. Toolbox: ExchangeSetup.log, nltest, /PrepareAD, /PrepareSchema, /PrepareAllDomains.1Symptoms2Why it happens3How to fix it1Check who and where you are2Fix the token3Run the steps from the schema master's domainand site4Remove stale otherWellKnownObjects entries5Still failing?4Verify the fix5Prevent it next timeTOOLBOXExchangeSetup.lognltest/PrepareAD/PrepareSchema/PrepareAllDomains
At a glance: how this guide is organised · 5 fix steps · 5 key tools

Symptoms#

Running Setup.exe /PrepareSchema, /PrepareAD or a CU upgrade stops at the readiness checks with:

Text
The Active Directory schema isn't up-to-date, and this user account isn't a member of the 'Schema Admins' and/or 'Enterprise Admins' groups.

Or C:\ExchangeSetupLogs\ExchangeSetup.log contains:

Text
Setup encountered a problem while validating the state of Active Directory: Exchange organization-level objects haven't been created, and setup can't create them because the local computer isn't in the same domain and site as the schema master. Run setup with the /PrepareAD parameter on a computer in the domain <domain_name> and site <Default_First_Site_Name>, and wait for replication to complete.

A third variant points at a stale reference in the Exchange configuration container:

Text
The well-known object entry B:<guid>:CN=Recipient Management\0ADEL:<guid>,CN=Deleted Objects,DC=contoso,DC=com on the otherWellKnownObjects attribute in the container object CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=contoso,DC=com points to an invalid DN or a deleted object. Remove the entry, and then rerun the task.

Older scripts fail for a simpler reason: since the September 2021 CUs, setup no longer accepts /IAcceptExchangeServerLicenseTerms. Use /IAcceptExchangeServerLicenseTerms_DiagnosticDataON or /IAcceptExchangeServerLicenseTerms_DiagnosticDataOFF.

Why it happens#

Each preparation step has its own permission and location rules:

StepAccount needsRun it from
/PrepareSchemaSchema Admins and Enterprise AdminsA computer in the same AD domain and site as the schema master
/PrepareADEnterprise Admins (plus Schema Admins if the schema isn't extended yet)Same domain and site as the schema master, with TCP 389 to every domain in the forest
/PrepareAllDomainsEnterprise AdminsIdeally a site with a domain controller from every domain
/PrepareDomainDomain Admins in that domain (plus Organization Management if the domain was created after /PrepareAD)Ideally a site with a domain controller from every domain

The errors above come down to four causes:

  • The groups aren't in your token. New group memberships only apply after you sign out and back in. In a non-elevated prompt, User Account Control also filters Schema Admins and Enterprise Admins down to "deny only". Setup then sees an account without the rights, even though AD lists it as a member.
  • Wrong site or domain. In a multi-site forest the schema master often sits in a different site from the Exchange servers. Setup won't create organization-level objects from there, and the setup wizard can't prepare AD in that situation at all.
  • Replication hasn't finished. Each step must reach every domain controller before the next one runs; preparing domains too early can fail.
  • Stale AD references. When an Exchange object such as a role group has been deleted, otherWellKnownObjects can still point to it in Deleted Objects.

How to fix it#

1. Check who and where you are#

Command Prompt
whoami /groups | findstr /i "Schema Enterprise"
netdom query fsmo
nltest /dsgetsite

Both groups should show Enabled group; Group used for deny only means the prompt isn't elevated. Then compare the schema master's site with the one nltest returned:

PowerShell
$sm = (Get-ADForest).SchemaMaster
Get-ADDomainController -Identity $sm -Server $sm | Select-Object HostName, Domain, Site

2. Fix the token#

Have the AD team add your admin account to Schema Admins and Enterprise Admins for the duration of the change, sign out and back in, then open the command prompt with Run as administrator.

3. Run the steps from the schema master's domain and site#

Use a domain member in that domain and site with a supported .NET Framework and the RSAT-ADDS feature (the Visual C++ runtime isn't needed for command-line AD preparation). Mount the ISO of the build you're about to install and run each step, checking replication in between:

Command Prompt
E:\Setup.exe /IAcceptExchangeServerLicenseTerms_DiagnosticDataOFF /PrepareSchema
repadmin /replsummary
E:\Setup.exe /IAcceptExchangeServerLicenseTerms_DiagnosticDataOFF /PrepareAD
repadmin /replsummary
E:\Setup.exe /IAcceptExchangeServerLicenseTerms_DiagnosticDataOFF /PrepareAllDomains

/OrganizationName is only for a brand-new organization. With a single domain, /PrepareAD already prepares it, so /PrepareAllDomains matters only for additional domains.

4. Remove stale otherWellKnownObjects entries#

For the well-known object error, download SetupAssist from Microsoft's CSS-Exchange project (aka.ms/ExSetupAssist) and run .\SetupAssist.ps1 -OtherWellKnownObjects. It saves the current entries to ExchangeContainerOriginal.txt, looks for references to deleted objects and writes ExchangeContainerImport.txt to remove them. Review that file, import it as the script instructs, then run /PrepareAD again.

Watch out: Don't hand-edit Exchange objects in ADSI Edit; Microsoft says to change values there only when its support team tells you to. Deleting Exchange containers or server objects to get past an error creates far bigger problems.

5. Still failing?#

Run .\SetupLogReviewer.ps1 -SetupLog C:\ExchangeSetupLogs\ExchangeSetup.log (also from CSS-Exchange). It looks for known problems in the log and tells you what to fix.

Verify the fix#

Read the three values setup updates (requires the Active Directory PowerShell module) and compare them with the table on Microsoft Learn:

PowerShell
$root = Get-ADRootDSE
$schema = Get-ADObject "CN=ms-Exch-Schema-Version-Pt,$($root.schemaNamingContext)" -Properties rangeUpper
$domain = Get-ADObject "CN=Microsoft Exchange System Objects,$($root.defaultNamingContext)" -Properties objectVersion
$org = Get-ADObject -SearchBase "CN=Microsoft Exchange,CN=Services,$($root.configurationNamingContext)" -SearchScope OneLevel -Filter "objectClass -eq 'msExchOrganizationContainer'" -Properties objectVersion
'rangeUpper {0} | objectVersion (Default) {1} | objectVersion (Configuration) {2}' -f $schema.rangeUpper, $domain.objectVersion, $org.objectVersion
BuildrangeUpperobjectVersion (Default)objectVersion (Configuration)
Exchange SE RTM170031324316763
Exchange 2019 CU15170031324316763
Exchange 2019 CU14170031324316762
Exchange 2016 CU23153341324316223

Reading the table: from 2019 CU14 to SE RTM only the Configuration value changes, so AD preparation must run but the schema stays the same; from 2019 CU15 nothing changes. Later SE updates can change these numbers, so check the current table. Then confirm every domain controller sees the schema value:

PowerShell
$schemaNC = (Get-ADRootDSE).schemaNamingContext
foreach ($d in (Get-ADForest).Domains) {
  Get-ADDomainController -Filter * -Server $d | ForEach-Object {
    $v = (Get-ADObject "CN=ms-Exch-Schema-Version-Pt,$schemaNC" -Server $_.HostName -Properties rangeUpper).rangeUpper
    '{0,-40} {1}' -f $_.HostName, $v
  }
}

Prevent it next time#

  • Agree a split with your AD team: they run /PrepareSchema and /PrepareAD from the schema master's site ahead of the change window, and Exchange admins run the upgrade with Organization Management rights.
  • Check AD replication health and take a system state backup of a domain controller first, because schema extensions can't be rolled back.
  • Remove temporary Schema Admins and Enterprise Admins memberships afterwards.
  • Clear the server prerequisites too (Exchange setup prerequisite errors), and if an upgrade fails part-way, recover it without deleting anything.

References#

Revision history: Oct 2026 — re-checked against Microsoft Learn: 1 correction.

Written and checked against current Microsoft Learn documentation. Test changes with a pilot group before rolling them out to everyone, and if an admin center path has moved since, search for the setting name instead.

Spotted a mistake, or did this fix work differently for you? Email me or message me on LinkedIn — corrections are credited in the article.

Written by

Omer Eltayeb

Intune Subject Matter Expert in Cairo, Egypt, former Microsoft Cloud Solutions Architect, Microsoft Certified Trainer and Microsoft Innovative Educator Expert (2024–26) and Microsoft Elevate Educator Expert (2026–27). I share practical, step-by-step guides, study plans, scripts and toolkits for Microsoft Intune, Configuration Manager, Microsoft Entra ID, Microsoft Defender, Exchange and Microsoft 365 with the community.

Microsoft Certified Trainer (MCT) 2026Microsoft Innovative Educator Expert 2025–2026Microsoft Elevate Educator Expert 2026–2027ISC2 Certified Information Systems Security Professional (CISSP)Microsoft 365 Certified: Enterprise Administrator Expert (MS-102)