Forum Discussion
Hiding Office 365 Groups Created by Teams from Exchange Clients
Just FYI all as no one had actually posted commands yet to get this done, i thought i would asssit. I used some of the links and adapted the power shell so that it works for me in the most direct way.
First examine the problem, my groups that were showing the GAL had HiddenFromAddressListsEnabled set to both true and false, but ALWAYS had HiddenFromExchangeClientsEnabled set to false. So that is the property i need to modify in order to correct the issue.
First we need to connect to office365 powershell. I have opened a powershell command prompt locally and run the following commands:
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -DisableNameChecking
Second we run the command to see how many groups are affected:
Get-UnifiedGroup -ResultSize Unlimited | select Name, DisplayName, HiddenFromExchangeClientsEnabled, HiddenFromAddressListsEnabled | where {$_.HiddenFromExchangeClientsEnabled -eq $False}
Third We dump those groups to a CSV file. Make sure the c:\temp\teams\ path exists or script will fail.
Get-UnifiedGroup -ResultSize Unlimited | select Name, DisplayName, HiddenFromExchangeClientsEnabled, HiddenFromAddressListsEnabled | where {$_.HiddenFromExchangeClientsEnabled -eq $False} | Export-csv -Path c:\temp\teams\HiddenGroups1.csv -NoTypeInformation -Encoding Ascii
Fourth, we fix them. I loaded this code into its own .ps1 file and ran it from the command line, but i think you could paste in the code directly.
$GroupList = Import-CSV "c:\temp\teams\HiddenGroups1.csv"
ForEach ($G in $GroupList) {
If ($G.HiddenFromExchangeClientsEnabled -eq "FALSE") {
Write-Host "Hiding" $G.DisplayName "from Exchange Clients"
Set-UnifiedGroup -Identity $G.Name -HiddenFromExchangeClientsEnabled:$True }
}Worked for all but two test groups, not sure why those ones it did not work for, but i just deleted them as they were from old tests.
hope it helps someone.
- Ponderosa007Jul 26, 2024Copper Contributor
BisonBrianTownsend
Same issue for us as well. New groups created in Teams are showing up in the GAL by default.
Did you end up submitting a ticket to Microsoft to get this resolved? - TonyRedmondJan 29, 2024MVPWell, I don't work for Microsoft, so I can't say... If you have a problem, make sure that Microsoft knows by filing a formal support request.
- BisonBrianTownsendJan 29, 2024Copper Contributor
VinceTTG TonyRedmond
18 months later and this is still happening.
I ran into the issue today with people trying to email the group address that shows up in the GAL - found this thread among some others that pointed me to the two "hiddenFrom*" attributes
I went through and bulk updated every group to be hidden
I then created a new test group using the TAC and it still gets created with the attributes set to False
so we have to manually hide all new groups created in the admin center.....
I'm struggling to understand why this was ever default behavior - why show a group in the address list that cannot accept emails?
Is there an ETA for this to be adjusted? - VinceTTGAug 01, 2022Copper ContributorThank for your reply Tony, I did the same test and it turns out the group was set to be hidden by default.
Looks like with us the issue is related to a single user. I will check with the user on how is he creating these groups that are then showing up on GAL.
The user is not an Admin so I am assuming that he is using the Teams app. I'll still check with him and update you here. - TonyRedmondAug 01, 2022MVP
That being said... I went back and looked at https://office365itpros.com/2021/02/25/teams-consistent-settings/ from last year, which reported on MC238795. This message center update says:
Unlike current teams created in the Teams admin center, after this change new teams will be hidden in Outlook experiences:
- The new team will not be displayed in Outlook clients, such as Outlook for Windows and Outlook on the web.
- The new team will not be displayed in the Outlook Address Book; in address lists for selecting message recipients; or in the Browse Groups dialog when searching groups.
Obviously, this isn't happening in the TAC right now, so I'll flag this to the developers. The teams created from the desktop client should be hidden from Outlook though...
- TonyRedmondAug 01, 2022MVPI just created a new team using the Teams desktop client and see:
get-unifiedgroup -id da87b93b-b0f7-40ad-a742-0eb420679ae9 | fl *hidden*
HiddenFromExchangeClientsEnabled : True
HiddenGroupMembershipEnabled : False
HiddenFromAddressListsEnabled : True
This is what I expect. The teams created from the TAC and Microsoft 365 admin center have HiddenFromExchangeClientsEnabled and HiddenFromAddressListsEnabled set to False. - VinceTTGAug 01, 2022Copper Contributorwe are creating the groups from the Teams client
- TonyRedmondAug 01, 2022MVPHow are you creating new groups? If you create them from the Teams client they'll be hidden. When you create them using an administrative interface (like from the Teams admin center or Microsoft 365 admin center), they're not and it's up to the admin to hide the groups if necessary.
- VinceTTGAug 01, 2022Copper ContributorThank you! This helped me hide the teams group that started showing up on the GAL, but I have to run this every time a new group is created as by default Microsoft includes Teams groups in GAL for no reason.