Skip to content

How to hide users from Global Address List (GAL)

The users, mailboxes, groups, and contacts in your organization are stored in the Global Address List. An excellent way is to hide these objects from the Global Address List (GAL) so users in your tenant can’t find them. In this article, you will learn how to hide users from the Global Address List in the Exchange admin center and PowerShell.

Hide recipients from GAL in Exchange admin center

We will show you how to hide all types of recipients in your organization from the Global Address List (GAL).

Note: When you hide one of these objects from the Global Address List, it will not be removed from the Microsoft 365 tenant, but it will only be hidden from GAL.

These are the different types of recipients:

  1. Mailboxes (User* and Shared mailboxes)
  2. Groups (Microsoft 365, Distribution list, Dynamic distribution list, Mail-enabled security)
  3. Resources (Room and Equipment mailboxes)
  4. Contacts

*If the user is not licensed, it doesn’t appear in the GAL, and you don’t have to set anything.

Note: It can take up to 24 hours before an object is hidden from the Global Address List (GAL).

Hide mailboxes from Global Address List

To hide user or shared mailboxes from the Global Address List, follow these steps:

  1. Sign in to Exchange admin center
  2. Expand Recipients > Mailboxes
  3. Select mailboxes
  4. Click Hide from address list
How to hide user and shared mailboxes from address list in Exchange admin center.
  1. Apply the changes and click Save

If you select multiple mailboxes, it will look like the below picture. Select Hide and Save the changes.

Hide multiple users from Global Address List (GAL) in Exchange admin center.

If you select a single mailbox, it will look like the below picture. Go to Apply changes to 1 selected mailbox(es) > Switch toggle to On and click Save.

Hide single user from address list in Exchange admin center.

Hide groups from Global Address List

You created a distribution list with members, but you want to hide these users. So, when you double-click the distribution list, it should not show the members.

To hide groups from the Global Address List, follow these steps:

  1. Sign in to Exchange admin center
  2. Expand Recipients > Groups
  3. Click on any group type (Microsoft 365, Distribution list, Dynamic distribution list, or Mail-enabled security)
  4. Click a group name
How to hide groups from GAL in Exchange admin center.
  1. Click the tab Settings
  2. Enable Hide this group from the global address list
  3. Click Save
Hide groups from Global Address List (GAL) groups save in Exchange admin center.

Hide resources from Global Address List

To hide room and equipment mailboxes from the Global Address List, follow these steps:

  1. Sign in to Exchange admin center
  2. Expand Recipients > Resources
  3. Click any resource type from the list
  4. Under the tab General
  5. Click Manage hide from GAL
How to hide resources from GAL in Exchange admin center.
  1. Hide from Global Address List > Switch toggle to On
  2. Click Save
Hide resources from Global Address List (GAL) in Exchange admin center.

Hide contacts from Global Address List

To hide contacts from the Global Address List, follow these steps:

  1. Sign in to Exchange admin center
  2. Expand Recipients > Contacts
  3. Click any contact
  4. Under the tab General
  5. Click Manage hide from GAL
How to hide contacts from GAL in Exchange admin center.
  1. Hide from Global Address List > Switch toggle to On
  2. Click Save
Hide contacts from Global Address List (GAL) in Exchange admin center.

Hide users from GAL in Hybrid with PowerShell

To hide users from the Global Address List in a Hybrid environment, we will use the Set-ADUser PowerShell cmdlet.

Run the below PowerShell command to hide the user in GAL.

Set-ADUser -Identity "Brenda Smith" -Replace @{msExchHideFromAddressLists=$true}

Run the PowerShell command to show the user in GAL.

Set-ADUser -Identity "Brenda Smith" -Replace @{msExchHideFromAddressLists=$false}

To check the msExchHideFromAddressLists attribute, we will use the Get-ADUser PowerShell cmdlet.

Run the below PowerShell command to check the status of the user.

Get-ADUser -Identity "Brenda Smith" -Properties msExchHideFromAddressLists

Hide recipients from GAL with PowerShell

To hide Exchange Online users from the Global Address List, you can also use PowerShell.

Connect to Exchange Online PowerShell

To be able to run PowerShell commands, you must Connect to Exchange Online PowerShell. Open Windows PowerShell as administrator, run the below cmdlet and sign in with your admin credentials.

Connect-ExchangeOnline

Hide Microsoft 365 mailboxes from Global Address List

To hide user, shared, room, or equipment mailboxes from the GAL, we will use the Set-Mailbox PowerShell cmdlet.

In our example, we will hide the user mailbox (Brenda.Smith@m365info.com).

Run the below PowerShell command to hide a user mailbox from GAL.

Set-Mailbox -Identity "Brenda.Smith@m365info.com" -HiddenFromAddressListsEnabled $true

Run the below PowerShell command to show a user mailbox in GAL.

Set-Mailbox -Identity "Brenda.Smith@m365info.com" -HiddenFromAddressListsEnabled $false

To check if you have hidden the user from GAL, we will use the Get-Mailbox PowerShell cmdlet.

Run the below PowerShell command to check if the user is hidden from GAL.

Get-Mailbox -Identity "Brenda.Smith@m365info.com" | fl HiddenFromAddressListsEnabled

Then, you can also check which user and shared mailboxes are hidden from GAL.

Run the below PowerShell command to show a list of all the mailboxes hidden from GAL.

Get-Mailbox -ResultSize Unlimited -Filter {HiddenFromAddressListsEnabled -eq $true} | Select DisplayName

How to hide Microsoft 365 Group from GAL

To hide a Microsoft 365 group from GAL, we need to use the Set-UnifiedGroup PowerShell cmdlet.

In our example, we will hide the Microsoft 365 group (Sales Team) from the GAL.

Run the below PowerShell command to hide a Microsoft 365 group in GAL.

Set-UnifiedGroup -Identity "SalesTeam@m365info.com"-HiddenFromAddressListsEnabled $true

Run the below PowerShell command to show a Microsoft 365 group in GAL.

Set-UnifiedGroup -Identity "SalesTeam@m365info.com"-HiddenFromAddressListsEnabled $false

To check if you have hidden the Microsoft 365 group from GAL, we will use the Get-UnifiedGroup PowerShell cmdlet.

Run the below PowerShell command to check if the Microsoft 365 group is hidden from GAL.

Get-UnifiedGroup -Identity "SalesTeam@m365info.com" | fl HiddenFromAddressListsEnabled

Next, check which Microsoft 365 groups are hidden from the Global Address List.

Run the below PowerShell command to show a list of all the Microsoft 365 groups hidden from GAL.

Get-UnifiedGroup -ResultSize Unlimited -Filter "HiddenFromAddressListsEnabled -eq 'True'" | Select Name, HiddenFromAddressListsEnabled

How to hide Distribution List or Security Group from GAL

To hide a distribution list or mail-enabled security group from GAL, we need to use the Set-DistributionGroup PowerShell cmdlet.

In our example, we will hide the distribution group (Sales UK) from the GAL.

Run the below PowerShell command to hide a distribution group from GAL.

Set-DistributionGroup -Identity "SalesUK@m365info.com"-HiddenFromAddressListsEnabled $true

Run the below PowerShell command to show a distribution group in GAL.

Set-DistributionGroup -Identity "SalesUK@m365info.com"-HiddenFromAddressListsEnabled $false

To check if you have hidden the distribution group from GAL, we will use the Get-DistributionGroup PowerShell cmdlet.

Run the below PowerShell command to check if a distribution group is hidden from GAL.

Get-DistributionGroup -Identity "SalesUK@m365info.com" | fl HiddenFromAddressListsEnabled

Then also check which distribution lists and mail-enabled security groups are hidden from GAL.

Run the below PowerShell command to show a list of all the distribution groups hidden from GAL.

Get-DistributionGroup -ResultSize Unlimited -Filter { HiddenFromAddressListsEnabled -eq $true } | Select Name, HiddenFromAddressListsEnabled

How to hide Dynamic Distribution List from GAL

To hide a dynamic distribution list from GAL, we need to use the Set-DynamicDistributionGroup PowerShell cmdlet.

In our example, we will hide the dynamic distribution list (Dynamic) from the GAL.

Run the below PowerShell command to hide a dynamic distribution list from GAL.

Set-DynamicDistributionGroup -Identity "Dynamic@m365info.com" -HiddenFromAddressListsEnabled $true

Run the below PowerShell command to show a distribution group in GAL.

Set-DynamicDistributionGroup -Identity "Dynamic@m365info.com" -HiddenFromAddressListsEnabled $false

To check if you have hidden the dynamic distribution list from GAL, we will use the Get-DynamicDistributionGroup PowerShell cmdlet.

Run the below PowerShell command to check if the dynamic distribution list is hidden from GAL.

Get-DynamicDistributionGroup -Identity "Dynamic@m365info.com" | fl HiddenFromAddressListsEnabled

Next, you can check which dynamic distribution lists are hidden from GAL.

Run the below PowerShell command to get a list of all the dynamic distribution lists hidden from GAL.

Get-DynamicDistributionGroup -ResultSize Unlimited -Filter { HiddenFromAddressListsEnabled -eq $true } | Select Name, HiddenFromAddressListsEnabled

Hide contact from Global Address List

To hide a contact (people outside your organization) from GAL, we will use the Set-MailContact PowerShell cmdlet.

In our example, we want to hide the contact (Cindy White) and use the Primary SMTP address.

Run the below PowerShell command to hide a contact from GAL.

Set-MailContact -Identity "cindyw@gmail.com" -HiddenFromAddressListsEnabled $true

Run the below PowerShell command to show a contact in GAL.

Set-MailContact -Identity "cindyw@gmail.com" -HiddenFromAddressListsEnabled $false

To check if you have hidden the contact from the Global Address List, we will use the Get-MailContact PowerShell cmdlet.

Run the below PowerShell command to check if the contact is hidden from GAL.

Get-MailContact -Identity "cindyw@gmail.com" | fl HiddenFromAddressListsEnabled

Let’s see a list of all the contacts hidden from the Global Address List.

Run the below PowerShell command to view all the contacts hidden from GAL.

Get-MailContact -ResultSize Unlimited -Filter {HiddenFromAddressListsEnabled -eq $true} | Select Name, HiddenFromAddressListsEnabled

Export list of all recipients hidden from GAL

To view which mailboxes, groups, and contacts are hidden from the Global Address List, you can export it to an Out-GridView.

Run the below PowerShell command to show a list of all the recipients hidden from GAL.

Get-Recipient -ResultSize Unlimited -Filter {HiddenFromAddressListsEnabled -eq $true} | Out-GridView
Show all recipients hidden from address list in Out-GridView

Run the below PowerShell command to export all recipients hidden from GAL to a CSV file.

Get-Recipient -ResultSize Unlimited -Filter { HiddenFromAddressListsEnabled -eq $true } | Select-Object Identity, DisplayName, RecipientType, HiddenFromAddressListsEnabled, IsDirSynced | Export-Csv "C:\temp\HiddenGAL.csv" -Encoding utf8 -NoTypeInformation 

Go to C:\temp and open the HiddenGAL.csv file with Microsoft Excel.

Show all recipients hidden from address list in CSV file

That’s it!

Read more: Manage Microsoft 365 users recycle bin »

Conclusion

You learned how to hide users from the Global Address List (GAL) in the Exchange admin center and PowerShell. In the Exchange admin center, you don’t have many options to hide an object from GAL compared to PowerShell. Remember to export the hidden recipients from GAL to an Out-GridView or CSV file to verify the changes.

Did you enjoy this article? You may also like Remove Azure AD users with Microsoft Graph PowerShell. Don’t forget to follow us and share this article.

o365info Team

o365info Team

This article was written by our team of experienced IT architects, consultants, and engineers.

This Post Has 0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *