How get version of domain schema and also how get current version of Forest and Domain Functional Level

HOW GET VERSION OF FOREST SCHEMA (adprep /forestprep)

dsquery * cn=schema,cn=configuration,dc=domainname,dc=local -scope base -attr objectVersion

repadmin /showattr * cn=schema,cn=configuration,dc=lab,dc=fujitsu,dc=local /atts:ObjectVersion

POWERSHELL : Get-ADObject (get-adrootdse).schemaNamingContext -Property objectVersion

13 – server 2000
30 – server 2003
31 – server 2003 r2
44 – server 2008
47 – server 2008 r2
56 – server 2012
69 – server 2012 r2
87 – server 2016

 

Get version of domain version (adprep /domainprep)

get-adobject -ldapfilter ‚(&(objectClass=Container)(cn=ActiveDirectoryUpdate))‘ -Properties *| select Name, CanonicalName,revision

REVISION NUMBER:

15 =Windows Server 2016
10 = Windows Server 2012R2
9 = Windows Server 2012
5 = Windows Server 2008R2
3 = Windows Server 2008

How get current version of Forest Functional Level

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

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 Server 2016

How get current version of Domain Functional Level

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

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
6,0 = Windows 2012 R2
7.0 = Windows Server 2016