Do I Need to Run apdrep for a New Domain Controller?


When introducing a new Windows Server version as a Domain Controller (DC), it’s common to wonder whether you need to run adadprep /forestprep or adprep /domainprep.

If you’re not sure whether to prepare your domain — especially if this is the first time you're introducing this version of Windows Server into the domain — follow this guide to figure it out.

Step 1: Check the Current AD Schema Version

The Active Directory schema version tells me whether a particular OS has already been introduced into the forest. To check it, I run:

Get-ADObject (Get-ADRootDSE).schemaNamingContext -Property objectVersion

This returns a number like 88, which corresponds to a specific version of Windows Server.

Active Directory Schema Version Reference Table

Windows Server VersionSchema VersionSchema Name
Windows 200013Windows2000
Windows Server 2003 RTM30Windows2003
Windows Server 2003 R231Windows2003 R2
Windows Server 200844Windows2008
Windows Server 2008 R247Windows2008 R2
Windows Server 201256Windows2012
Windows Server 2012 R269Windows2012 R2
Windows Server 201687Windows2016
Windows Server 201988Windows2019
Windows Server 202288Windows2022
Windows Server 2025 96 Windows2025 

Note: Windows Server 2022 does not introduce a new schema version. If the schema is already at 88 from a Server 2019 promotion, no additional forest prep is needed.

Step 2: Determine Whether You Need ADPREP

I follow this general rule:

  • If the Domain Controller running this Windows version has been promoted before, and the schema version is lower than required, then you need to run:

    adprep /forestprep (once per forest, on the Schema Master)
    adprep /domainprep (once per domain)

If the schema is already at the correct version (e.g., 88 for Server 2022), and the DCs from that OS version already exist, then you don’t need to run adprep again.

Note : Running the commands a second time does nothing harmful — it simply exits after confirming the schema is already prepared.

Script to Check Schema Version

Here’s a quick PowerShell snippet that outputs the schema version and the associated OS:

$schemaVersion = (Get-ADObject (Get-ADRootDSE).schemaNamingContext -Property 
objectVersion).objectVersion

$schemaMap = @{
    13 = "Windows 2000"
    30 = "Windows Server 2003"
    31 = "Windows Server 2003 R2"
    44 = "Windows Server 2008"
    47 = "Windows Server 2008 R2"
    56 = "Windows Server 2012"
    69 = "Windows Server 2012 R2"
    87 = "Windows Server 2016"
    88 = "Windows Server 2019 / 2022"
    96 = "Windows Server 2025 (Preview)"
}

"Current Schema Version: $schemaVersion"
"Corresponds to: " + ($schemaMap[$schemaVersion] ?? "Unknown version")

Summary

If I’m introducing a new OS version as a Domain Controller and I’m unsure whether the environment has already been prepared, I always:

  1. Check the schema version
  2. Refer to the version table
  3. Only run adprep if the schema version is older than what my new DC needs
Previous Post Next Post

نموذج الاتصال