How to Check the Active Directory Schema Version using PowerShell

The Importance of the Active Directory Schema

In a Windows Server environment, the Active Directory (AD) Schema is the fundamental blueprint of your entire domain. It defines every single object class (Users, Computers, Printers) and the attributes those objects can possess (First Name, Department, Employee ID).

When Microsoft releases a new version of Windows Server (e.g., upgrading from Server 2016 to Server 2022) or when you install enterprise software like Microsoft Exchange, the installation process fundamentally rewrites and expands this blueprint. Before attempting a major domain upgrade or installing complex software, system administrators must verify the exact version number of their current AD Schema to ensure compatibility. If you attempt an upgrade on an unsupported schema, you risk catastrophic corruption of your domain.

Understanding Schema Versions

The Schema version is represented by a simple integer. Here is a quick reference for modern Windows Server versions:

  • 69 = Windows Server 2012 R2
  • 87 = Windows Server 2016
  • 88 = Windows Server 2019 / Windows Server 2022

Method 1: Querying AD via PowerShell (The Modern Way)

If you are running the command from a Domain Controller or an IT workstation that has the Active Directory PowerShell module (RSAT) installed, you can query the directory directly.

Open an elevated PowerShell prompt and run the following command:

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

Breaking Down the Command:

  • Get-ADRootDSE: This discovers the core configuration information about your specific domain.
  • .schemaNamingContext: This isolates the exact LDAP path to the Schema partition (e.g., CN=Schema,CN=Configuration,DC=corp,DC=com).
  • Get-ADObject: This takes that LDAP path and queries the actual Active Directory database.
  • -Property objectVersion: This extracts the specific integer we are looking for.

The output will present a small table. Look at the objectVersion column. If it says 88, your domain is fully upgraded to the Server 2019/2022 standard.

Method 2: Using the System Directory (No Modules Required)

If you are logged into a random server that does not have the Active Directory PowerShell module installed, the previous command will fail. However, you can still find the schema version by directly querying the registry via PowerShell.

When a Domain Controller is promoted, Windows hardcodes the schema version into a specific registry key.

Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\NTDS\Parameters" | Select-Object -ExpandProperty "Schema Version"

This command will simply spit out the integer (e.g., 87). This method is incredibly fast and highly useful for automated auditing scripts running on minimal Server Core installations.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.