When creating a team, an Office 365 group is also created and will appear in a users Outlook. The following code will connect to Office365's PowerShell module and hide the specified group.



Change "IT Test Team" to the group name that you want to hide.


PowerShell code:

<# Run this to connect to Office365 Exchange PowerShell online #>
$Cred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic -AllowRedirection
Import-PSSession $Session

<# This is the command to hide the group "IT Test Team". Change this group name to suit #>
Set-UnifiedGroup "IT Test Team" -HiddenFromExchangeClientsEnabled:$true

<# Check to see if this group has been hidden (shows all hidden groups)#>
Get-UnifiedGroup -ResultSize Unlimited | Where-Object {$_.HiddenFromExchangeClientsEnabled -eq $true}