Erhalten-Briefkasten - OrganizationalUnit „OU=orgunitname, dc=subdomain, dc=topdomain“ - ResultSize 8000 - RecipientTypeDetails linkedmailbox | % {
$missinglth = $missingplc = $false
$addresses = $_.emailaddresses | ? {$_.prefixstring - eq „smtp“} |
% {$_.addressstring} | Vorwählen-Schnur - Muster „@ (. +)“ | % {$_.matches [0] .groups [1] .value.tolower ()}
wenn ($addresses - notcontains „plc.com“) {$missingplc = $true}
wenn ($addresses - notcontains „lth.com“) {$missinglth = $true}
wenn ($missinglth - oder $missingplc) {
Neu-Gegenstand - TypeName psobject - Eigentum @ {
Name = $_.name
Identität = $_.identity;
Missinglth = $missinglth;
Missingplc = $missingplc
}
}
} | ft nennen, Identität, missinglth, missingplc
|