Conseguir-Caja - OrganizationalUnit “OU=orgunitname, dc=subdomain, dc=topdomain” - ResultSize 8000 - linkedmailbox de RecipientTypeDetails | % {
$missinglth = $missingplc = $false
$addresses = $_.emailaddresses | ¿? {$_.prefixstring - eq “smtp”} |
% {$_.addressstring} | Seleccionar-Secuencia - patrón “@ (. +)” | % {$_.matches [0] .groups [1] .value.tolower ()}
si ($addresses - notcontains “plc.com”) {$missingplc = $true}
si ($addresses - notcontains “lth.com”) {$missinglth = $true}
si ($missinglth - o $missingplc) {
Nuevo-Objeto - psobject de TypeName - característica @ {
nombre = $_.name
Identidad = $_.identity;
Missinglth = $missinglth;
Missingplc = $missingplc
}
}
} | los pies nombran, identidad, missinglth, missingplc
|