Here’s how to get Forest Functional Level (FFL) and Domain Functional Level (DFL) of Active Directory from command line or using PowerShell:

Get Domain Functional Level using PowerShell:

Get-ADDomain | fl Name,DomainMode

Get Forest Functional Level using PowerShell:

Get-ADForest | fl Name,ForestMode

 


 

Get Forest Functional Level using dsquery:

dsquery * “CN=Partitions,CN=Configuration,DC=lab,DC=local” -scope base -attr msDS-Behavior-Version

Conversion table:

0 = Windows 2000
1 = Windows 2003 interim
2 = Windows 2003
3 = Windows 2008
4 = Windows 2008 R2
5 = Windows 2012
6 = Windows 2012 R2
7 = Windows 2016

Reference here.

Get Domain Functional Level using dsquery:

dsquery * “DC=lab,DC=local” -scope base -attr msDS-Behavior-Version ntMixedDomain

Conversion table:

0, 0 = Windows 2000 Native
0, 1 = Windows 2000 Mixed
2, 0 = Windows 2003
3, 0 = Windows 2008
4, 0 = Windows 2008 R2
5, 0 = Windows 2012

Reference here.

Get the Active Directory Schema version using dsquery:

dsquery * “CN=Schema,CN=Configuration,DC=lab,DC=local” -scope base -attr objectVersion

13 = Windows 2000 Server
30 = Windows Server 2003 RTM/SP1/SP2
31 = Windows Server 2003 R2
44 = Windows Server 2008 RTM
47 = Windows Server 2008 R2
56 = Windows Server 2012 RTM
69 = Windows Server 2012 R2
87 = Windows Server 2016

Reference for Schema objectVersion.