When we create SharePoint site or teams, the system automatically creates a Microsoft 365 group dependent with this resources. Thus, we can manage permissions and collaborative activities such as mail or chat.
But you may not want to see the Microsoft 365 group in the Global address list to avoid confusion. Sometimes the group may still appear on the GAL even though you hide its visibility from the Exchange Admin Center.
Normally, it is sufficient to select the relevant group from the Exchange Admin Center>>Recipients>>Groups menu and select the “Hide this group from the global address list” option in the Settings menu. But if the group still appears on the GAL then it’s time to use Powershell.
After connecting to Exchange Online Powershell, we will hide the M365 group from the GAL with the command we will run.
After connecting to Exchange Online with the # Connect-ExchangeOnline command, run the following command. (replace firstname.lastname@example.org with the group email address)
# Set-UnifiedGroup -Identity "email@example.com" -HiddenFromExchangeClientsEnabled:$True
If you encounter the “no settings have been modified” warning, change $True at the end of the command to #False and run it. Then change this value back to #True and run.
When you check the GAL again after running the commands, you will notice that the specified group does not appear. It may take 24-48 hours for changes to be reflected in the Offline GAL.