If you are one of the Microsoft Teams enthusiasts and started using Teams from its early stage, you have ended up with many similar or unintended email IDs in your Outlook GAL. For each Team, Office 365 creates its own group’s email ID and it used to make the email ID available in the GAL.
After some noise in the User Voice, Microsoft stop showing those email IDs in the GAL by default. But if you already have many group email IDs showing in your GAL that you want to hide, use the following code snippets:
The above is a soft-delete of the groups and will be retained for another 30 days (for admin to restore). To reuse the same group internal name, those groups need to be permanently deleted. We will need to use AzureAD PowerShell Module for this. Run the following commands and sign-in again to see the list of deleted groups.
Import-Module AzureADPreview Connect-AzureAD Get-AzureADMSDeletedGroup #The list can be exported in a excel for curation. Get-AzureADMSDeletedGroup | Select-Object -Property DisplayName, ID | Export-Csv -Path .\DeletedGroups.csv -NoTypeInformation
After modifying the export file, same can be used to permanently delete those groups.
Issues: if you are getting the following error, you have missed the step highlighted above in red. Use IE/Edge. You cannot start application Microsoft Exchange Online Powershell Module from this location because it is already installed from a different location.