Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#Query AD tiering level from AD
Function Get-ADTieringLevel
{
Param(
$ServerName
)
$OU = ([adsisearcher]"(&(name=$ServerName)(objectClass=computer))").FindOne().path
If($OU.Contains("Domain Controllers") -or $OU.Contains("Tier0")){
"TIER-0"
}
ElseIf($OU.Contains("Tier1")){
"TIER-1"
}
ElseIf($OU.Contains("Tier2")){
"TIER-2"
}
Else{
"TIERING MISSING"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment