skip to Main Content

Check Exchange Schema version with PowerShell

You want to know if your Active Directory (AD) is up to date. For example, you want to check and verify the Exchange 2016 schema version before and after an upgrade to Exchange 2016 CU16. Read the article, if you need to prepare Active Directory and domains for Exchange Server. In this article, you will learn how to check the Exchange schema version with PowerShell.

Why checking Exchange schema version information

It’s good to check and verify the Exchange schema version, for example:

Get Exchange schema version with PowerShell commands

Run PowerShell as administrator. Run the following commands one by one.

PS C:\> # Exchange Schema Version
PS C:\> $sc = (Get-ADRootDSE).SchemaNamingContext
PS C:\> $ob = "CN=ms-Exch-Schema-Version-Pt," + $sc
PS C:\> Write-Output "RangeUpper: $((Get-ADObject $ob -pr rangeUpper).rangeUpper)"
RangeUpper: 15332
 
PS C:\> # Exchange Object Version (domain)
PS C:\> $dc = (Get-ADRootDSE).DefaultNamingContext
PS C:\> $ob = "CN=Microsoft Exchange System Objects," + $dc
PS C:\> Write-Output "ObjectVersion (Default): $((Get-ADObject $ob -pr objectVersion).objectVersion)"
ObjectVersion (Default): 13237
 
PS C:\> # Exchange Object Version (forest)
PS C:\> $cc = (Get-ADRootDSE).ConfigurationNamingContext
PS C:\> $fl = "(objectClass=msExchOrganizationContainer)"
PS C:\> Write-Output "ObjectVersion (Configuration): $((Get-ADObject -LDAPFilter $fl -SearchBase $cc -pr objectVersion).objectVersion)"
ObjectVersion (Configuration): 16217

Get Exchange schema version with Get-ADversions script

Download the script Get-ADversions.ps1 and save it in the C:\scripts\ folder. Run PowerShell as administrator. Make sure that you set the Execution Policy to Unrestricted. Press Y and Enter. If you don’t, the script will not run.

PS C:\> Set-ExecutionPolicy Unrestricted

Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the
security risks described in the about_Execution_Policies help topic at http://go.microsoft.com/fwlink/?LinkID=135170. Do you want to
change the execution policy?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): Y

Adjust the path to the C:\scripts\ folder and run the Get-ADversions.ps1 script.

PS C:\> cd C:\scripts\
PS C:\scripts> .\Get-ADversions.ps1
RangeUpper: 15332
ObjectVersion (Default): 13237
ObjectVersion (Configuration): 16217

After running the PowerShell script, you will see an output of the Active Directory versions.

RangeUpper = 15332
ObjectVersion (Default) = 13237
ObjectVersion (Configuration) = 16217

The next step is to check and verify the schema.

Check and verify Active Directory versions

How to confirm the Exchange Active Directory versions? Visit the page Exchange schema versions to get a list of the object versions.

We can confirm that Exchange 2016 schema version is up to date for Exchange 2016 CU16. In fact, Exchange 2016 CU15, Exchange 2016 CU14, and Exchange 2016 CU13 are eligible as well.

Check Exchange schema version with PowerShell check list

Conclusion

To sum it up, you learned how to check and verify the Exchange schema version with PowerShell. Run the Get-ADversions.ps1 PowerShell script and check if the Active Directory versions are correctly shown.

Did you enjoy this article? If so, you may like Exchange Server in DMZ or LAN network. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 6 Comments

  1. if am to upgrade from exchange cu20 to Cu22, do i need to use CU21 installation file to extend the schema or i can leverage on CU22 as CU22 required no schema upgrade

  2. Dear Ali
    How are you?
    Thanks for your Article.
    i have question about that power shell scrip (Get-ADversions.ps1 ).
    Why this script work only on windows server 2016 and not work in windows server 2019?

  3. Can’t explain why for Exchange Object Version (domain) “CN=Microsoft Exchange System Objects” I get 6936 which apparently corresponds to Exchange 2003.
    I transitioned successfully from 2003 to 2010 and from 2010 to 2016.
    No issue just wondering if I need to do anything or leave it like this?!

    1. Try the following. Mount the Exchange CU ISO file and run Command Prompt as administrator. Browse to the drive and run the command:

      Setup.exe /IAcceptExchangeServerLicenseTerms /PrepareAllDomains

Leave a Reply

Your email address will not be published. Required fields are marked *