If Statements and AD Objects
Check if AD Object returned is group or user:
if ($adObject.objectClass -eq "group"){
}
if ($adObject.objectClass -eq "user"){
}
Check if multiple users returned from a get-aduser query:
if ($User -is [system.array]){
# Throw an error, multiple users returned
}
elseif ($User -is [Microsoft.ActiveDirectory.Management.ADAccount]){
# do something
}