Ottenere-Cassetta postale - OrganizationalUnit “OU=orgunitname, dc=subdomain, dc=topdomain„ - ResultSize 8000 - linkedmailbox di RecipientTypeDetails | % {
$missinglth = $missingplc = $false
$addresses = $_.emailaddresses | ? {$_.prefixstring - eq “smtp„} |
% {$_.addressstring} | Selezionare-Stringa - modello “@ (. +)„ | % {$_.matches [0] .groups [1] .value.tolower ()}
se ($addresses - notcontains “plc.com„) {$missingplc = $true}
se ($addresses - notcontains “lth.com„) {$missinglth = $true}
se ($missinglth - o $missingplc) {
Nuovo-Oggetto - psobject di TypeName - proprietà @ {
nome = $_.name
Identità = $_.identity;
Missinglth = $missinglth;
Missingplc = $missingplc
}
}
} | i ft chiamano, identità, missinglth, missingplc
|