Hide an Entire OU of Contacts
Get-MailContact -OrganizationalUnit "ADOU" | Set-MailContact -HiddenFromAddressListsEnabled $trueReplace
"ADOU" with the actual organisational unit containing the contacts you want to hide, for example "contoso.com/External Contacts".
Hide a Single Contact
Set-MailContact -Identity "contact alias" -HiddenFromAddressListsEnabled $true
Checking What’s Currently Hidden
Get-MailContact -ResultSize Unlimited | Where-Object {$_.HiddenFromAddressListsEnabled -eq $true} | Select Name,PrimarySmtpAddress
Address list visibility changes can take a little while to propagate depending on your Exchange topology (particularly in hybrid or multi-server environments), so give it some time before assuming a change hasn’t worked.
Reversing the Change
To unhide a contact (or a whole OU) later, run the exact same commands with$false instead of $true — there’s no separate “unhide” cmdlet, it’s the same property flipped back.
Exchange Online and Hybrid Considerations
This sameHiddenFromAddressListsEnabled property and the Set-MailContact cmdlet work identically against Exchange Online, so the commands above apply whether the contact lives on-prem or in the cloud. In a hybrid environment where mail contacts are synced from on-premises Active Directory via Entra Connect (formerly Azure AD Connect), the visibility flag itself is typically managed on the source object and synced through — changing it directly in Exchange Online for a synced object may get overwritten on the next sync cycle, so confirm which side is authoritative for the object before making the change there instead of on-prem.
Why Hide Rather Than Delete
Hiding a contact instead of removing it keeps mail flow working exactly as before (anyone who already has the address saved, or who addresses mail to it directly, is unaffected) while simply removing it from the searchable address book — useful for contacts that are still functionally needed (a forwarding address, a legacy vendor alias) but shouldn’t be something staff stumble across during a normal GAL lookup.Resources
Gear We Recommend
A few general tech accessories worth having alongside this.
Browse our General Tech Accessories picks on AmazonAs an Amazon Associate, TechyGeeksHome earns from qualifying purchases.
Discover more from TechyGeeksHome
Subscribe to get the latest posts sent to your email.