Skip to 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 2013/2016/2019 schema version before and after an upgrade to the newer Exchange Server version. In this article, you will learn how to check the Exchange schema version with PowerShell.

Why check Exchange schema version information

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

Get Exchange schema version with Get-ADversions PowerShell script

Download the script Get-ADversions.ps1 and save it in the C:\scripts\ folder.

Ensure that the file is unblocked to prevent any errors when running the script. Read more in the article Not digitally signed error when running PowerShell script.

Another option is to copy and paste the below code into Notepad. Give it the name Get-ADversions.ps1 and place it in the C:\scripts folder.

# Exchange Schema Version
$sc = (Get-ADRootDSE).SchemaNamingContext
$ob = "CN=ms-Exch-Schema-Version-Pt," + $sc
Write-Output "RangeUpper: $((Get-ADObject $ob -pr rangeUpper).rangeUpper)"

# Exchange Object Version (domain)
$dc = (Get-ADRootDSE).DefaultNamingContext
$ob = "CN=Microsoft Exchange System Objects," + $dc
Write-Output "ObjectVersion (Default): $((Get-ADObject $ob -pr objectVersion).objectVersion)"

# Exchange Object Version (forest)
$cc = (Get-ADRootDSE).ConfigurationNamingContext
$fl = "(objectClass=msExchOrganizationContainer)"
Write-Output "ObjectVersion (Configuration): $((Get-ADObject -LDAPFilter $fl -SearchBase $cc -pr objectVersion).objectVersion)"

Run PowerShell as administrator. Make sure that you set the Execution Policy to Unrestricted. If you don’t, the script will not run.

Set-ExecutionPolicy Unrestricted -Force

Now run the Get-ADversions.ps1 PowerShell script.

C:\scripts\.\Get-ADversions.ps1

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

  • RangeUpper: 17003
  • ObjectVersion (Default): 13242
  • ObjectVersion (Configuration): 16759

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 2019 schema version is up to date for Exchange 2019 CU11.

Check Exchange schema version with PowerShell check list

Conclusion

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 8 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 *