get-mailcontact "yourcontact" | Set-mailContact -HiddenFromAddressListsEnabled $true
Hide contact from Global Addresslist (GAL)
Leave a reply
get-mailcontact "yourcontact" | Set-mailContact -HiddenFromAddressListsEnabled $true
Get-mailcontact -OrganizationalUnit "contoso.com/path/to/ou" | Set-mailContact -EmailAddressPolicyEnabled $false -whatif
get-mailcontact -OrganizationalUnit "contoso.com/path/to/ou" | Set-mailContact -HiddenFromAddressListsEnabled $true -whatif
get-mailcontact -OrganizationalUnit "contoso.com/path/to/ou" |
foreach {
$a = $_.emailaddresses
$b = $_.emailaddresses
foreach($e in $a)
{
if ($e.tostring() -match "@emailtoremove.com")
{ $b -= $e; }
}
$_ | Set-mailContact -emailaddresses $b } -whatif }