I get this requirement from few of my customers that, How to hide External Contacts from GAL.
- Connect to Exchange Online Powershell
- Run below Command:
Set-MailContact -Identity “[email protected]” -HiddenFromAddressListsEnabled $true
Feel free to comment for any questions.
How about multiple contacts and all external contacts to hide?
Multiple contacts you may use csv file(Create csv with “Email” column) : Import-Csv -Path “C:\User.csv” | Foreach{Set-Mailcontact -Identity $_.Email -HiddenFromAddressListsEnabled $true}
For All : Get-Mailcontact | Set-MailContact -HiddenFromAddressListsEnabled $true
Feel free to comment back if you have any questions.