If you’re an organization that leverages Office 365 Groups/Unified Groups/Outlook Groups/Groups/I’m Running Out of Names Here© you’ll eventually run into a situation where you’ll want to hide those addresses from the Global Address List.
For example, you might have an existing shared mailbox or distribution list for users to communicate with your HR department with the e-mail address hr@contoso.com and the description “HR”. Now imagine that the HR group also creates a Unified Group to leverage Planner and a SharePoint site AND as luck would have it they left the name of their groups as “HR”. Even though the Unified Group will use a different e-mail address (let’s say hrgroup@contoso.com) it will still appear as “HR” in the GAL when users are performing searches.
This leads to a ton of user confusion and miscommunication; exactly the thing Unified Groups is supposed to curtail. Thankfully, you can hide a Unified Group from the GAL with a simple PowerShell cmdlet - Set-UnifiedGroup.
The HiddenFromAddressListsEnabled parameter “specifies whether the Office 365 Group appears in the global address list (GAL) and other address lists in your organization”. By default, this value is set to False ($false), meaning that the group is visible in the GAL and other address lists. By setting this value to True ($true), the group can be hidden from the GAL. The group can still receive messages but will not be visible in the GAL and will not appear in the Groups Discover view.
So, back to our hypothetical “HR” group. Let’s hide it:
Set-UnifiedGroup -Id hrgroup@contoso.com -HiddenFromAddressListsEnabled $true
You can verify that the change was successful by running the Get-UnifiedGroup cmdlet:
Get-UnifiedGroup -Id hrgroup@contoso.com | Select HiddenFromAddressListsEnabled
Once hidden, it can take several hours for the Unified Group to be purged from the address list(s) and then you still have to wait for the clients to pull their address book updates.