Hiding Office 365 Groups Created by Teams from Exchange Clients

MVP


Teams now hides the Office 365 Groups that it creates from Exchange clients (Outlook, OWA, and the mobile apps). That’s as it should be for groups created for new teams. If you want to hide groups created for older teams, you can run the Set-UnifiedGroup cmdlet, but that soon becomes boring when you might have hundreds of groups to process. PowerShell to the rescue once again.

https://www.petri.com/hiding-office-365-groups-exchange-clients

29 Replies

Hm, so am I to assume that it actually works for you? None of the Teams I toggled the flags for have disappeared from either Outlook and OWA. And while Outlook can be excused as I'm on the deferred channel, shouldn't OWA at least be aware of the flags? Sigh...

 

P.S. Ordered hash tables and such, color me impressed  :)

As I say in the piece, the change is rolling out... and while the change is effective in the back-end (i.e. you can set groups to be hidden from Exchange clients now), some client updates are also necessary. These will come in OWA and Outlook (to respect the flag) and Teams (to set the flag). Don't be so impatient.

 

As to ordered hash tables, I used these a lot to capture Office 365 data with PowerShell. Once in the hash table, you can do so much with data... as proven here.

This seems to be live now, both in OWA and Outlook (9126.2152).

Yep, working in both OWA, Outlook desktop, and Outlook for iOS (latest update). Groups disappear after a client refreshes, which in the case of Outlook desktop means the next time it runs Autodiscover (15 minutes). Outlook for iOS appears to refresh its folder list if you access it or the Groups section of the folder list. OWA refreshes itself periodically, or you can refresh the browser.

 

One of the side-effects (logical) is that if a group is hidden from Exchange clients, it disappears from Favorites. Just saying...

I get the idea or desire to hide groups created by teams, but there is one thing I'm missing in that scenario that works with email, but currently doesn't with teams.
How do I contact a group that I'm not a member of ? This works in an email/distribution list scenario, but I haven't figured it out in Teams.

Teams doesn't appear in an address list like other mail-enabled objects unless its Office 365 Group is not hidden from the lists, so it is hard to know when private teams are available. Public teams can be found by the Join or Create a team option, which presents a list of suggested public teams available to the user. The search function on the same screen can be used to find other public teams that don't make the suggested list, which is determined by reference to signals in the Graph. Private teams don't appear in suggestions, so the only way to join them is to contact the team owner (how you learn about the existence of the team is another matter - perhaps via a coffee room conversation?).

all true, but doesn't really solve the whole distribution list demand. When I want to move away from Outlook to Teams, I need to have the option to contact other departments or groups without being part of that department, right?
Its very unlikely for me as a member of the "IT Team" to also be a member of the "Sales TEAM" and therefore I have no option to contact the whole sales team, without adding every single member into a private chat

The simple solution is to create a mail contact in your tenant directory for a channel email address in the teams that you think people will want to email. The mail contact will be in the GAL and can be addressed like any other email recipient. Messages will show up in the channel in the target team and can be actioned there by the sales team or whatever. And if you are nice, they might invite you into the team.

 

Seriously, this discussion shows that moving from Outlook to Teams is not possible if you still need some of the functionality available in Outlook...

Interesting idea, but we're possibly talking past each other - or I'm just misreading this :) Also sorry that I'm derailing the original purpose of that thread.
I'm not interested in Outlook to Teams communication, which would work just fine by adding the groups smtp address into the TO: field.
If I were in a Teams only environment (no Outlook available), how would I contact a different team/department without being a member of that private team?
I'm basically missing the feature to @mention a team which I'm not a member of, or a direct private chat with a team that I'm not a member of.

It is that missing functionality, that would keep me from hiding Teams from the Outlook UI or the GAL. Teams enhances team/department-internal communication, but kind of prevents cross-team communication.

The ability to @mention a team would require you to know the name of the team, no?

 

It's worth also saying that if you do not hide groups (used for teams) from Exchange, you will certainly see them in the GAL and other address lists, and you will be able to send email to those groups, but there's no guarantee that your email will reach anyone because a) the members of the team you send email to might never look at conversations in the group mailbox, which is where email will end up, and b) the group might not distribute copies of conversations to members in email, so the message won't reach members that way either...

all true. I still don't understand how cross team communication within teams is suppose to happen in an environment where most groups are private.
But I will no longer hijack your thread and I will start a discussion in the Teams Community here.

@Ivan Unger 

If the group is potentially expecting external messages from people outside the group, perhaps the owner of the group should create the corresponding Yammer group which could either be left open or private.  Allow said guest to request to join the Yammer group (still keeping that outside communication outside of Teams) but then add a new tab in the group within Teams with the Yammer group.  I've been thinking how I can do this going forward with some of our scenarios as well (haven't done so as yet).

The only issue I still believe is that there is no notifications baked in to Teams for when a new Yammer message arrives in the Yammer group via the Teams Tab.  Would be nice to have a Teams Banner who up but for now I'd imagine it's just the usual notifications via Yammer.

 

I realise this is an old topic now so please disregard if not required anymore.

Hi, I'd still like to message a team (just like I can mail to a distribution group without being part of it), but introducing Yammer into the mix is not an option. Users are already confused by the many communication options.

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.

@Tony Redmond 

@Tony Redmond This simply is not true.  Every single team we create has its O365 group show up in the GAL.

@PhilHemingwaySTV I'm sure that every team does turn up in the GAL, but only if an action is taken to update its HiddenFromExchangeClientsEnabled property. All teams created through team-aware admin interfaces set this property to $False. If you create using an ISV app, PowerShell, or some Graph-enabled app, you might find that the property is set to $True. For instance, even Teams sets the property to $True for the special team it creates to control who's allowed to create approvals templates. But the general point holds true: teams created through Teams set HiddenFromExchangeClientsEnabled to $False.

That has not been the case in our environment, and I just closed a ticket with Microsoft today, confirming as much.

Here's the relevant part of their email response, "When you create it from PowerShell or the Teams admin center it will be visible. Please create from the Teams App and observe the behavior (the group should be hidden by default)."


Specifically, teams created through the Teams admin interface are visible in the GAL. We require that new teams be created by admins, so our users are prevented from creating their own in the app... and for admins it was natural to create teams through the Teams admin interface. Every last one since we deployed Teams to the company is showing in the GAL. I'd have to get a colleague to run the Exchange PowerShell command for me since I'm not the Exchange admin, but I don't doubt at all they're set to $True.

So it's pretty frustrating that Microsoft documentation says when you create a team in Teams it will not show in the GAL, because this has not been the case at all for our organization, and I feel like it's a glaring error that needs to be corrected.
Right. There's a known gap at present (documented in Office 365 for IT Pros https://gum.co/O365IT/ that the Teams admin center doesn't hide newly created teams. When you create new teams with PowerShell or the Graph, you have full control over the parameters of what the newly created team should do, including the ability to tweak the group hidden setting. But every group created using the Teams desktop, browser, or mobile client should be hidden.

Fortunately, the solution is easy. Have someone with admin permissions connect to Exchange Online PowerShell and run these two lines:

[array]$Groups = Get-UnifiedGroup -Filter {ResourceProvisioningOptions -eq "Team"} -ResultSize Unlimited
ForEach ($Group in $Groups) { Set-UnifiedGroup -Identity $Group.ExternalDirectoryObjectId -HiddenFromExchangeClientsEnabled:$True -HiddenFromAddressListsEnabled:$True }