Skip to content

Instantly share code, notes, and snippets.

@Kaidja
Created September 18, 2021 18:38
Show Gist options
  • Save Kaidja/bcb1f023b58863719dbc0ae12ca5b49e to your computer and use it in GitHub Desktop.
Save Kaidja/bcb1f023b58863719dbc0ae12ca5b49e to your computer and use it in GitHub Desktop.
#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