# Raise Forest Functional Level
$forest=Get-ADForest

# 2012R2 Level
Set-ADForestMode -Identity $forest -Server $forest.SchemaMaster -ForestMode Windows2012R2Forest -Force
# 2016 Level
Set-ADForestMode -Identity $forest -Server $forest.SchemaMaster -ForestMode Windows2016Forest -Force