One minute
Determine Forest and Domain Functional Levels in Powershell
A quick and easy post:
Import-Module ActiveDirectory
# Get the forest functional level
(Get-ADForest).ForestMode
# Get the domain functional level
(Get-ADDomain).DomainMode
Read other posts