Hide Office 365 Group from GAL using PowerShell

Requirement: Hide Office 365 Group from GAL (Global Address List)

How to Hide Office 365 Group from GAL using PowerShell?
If you don't wish your Office 365 group appears in the global address list (GAL), you can hide it from appearing in GAL using Set-UnifiedGroup cmdlet. Here is how to hide the group from address list:
#Get Credentials to connect
$Credential = Get-Credential
 
#Create the session
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ `
           -Credential $Credential -Authentication Basic -AllowRedirection
 
#Import the session
Import-PSSession $Session -DisableNameChecking 

#hide office 365 group from gal using powershell
Set-UnifiedGroup -Identity "Vendors@TheCrescentTech.com" -HiddenFromAddressListsEnabled $True

#Remove the session
Remove-PSSession $Session

This PowerShell hides Office 365 Group from GAL. Similarly, You can hide Office 365 group from Exchange clients using:
Set-UnifiedGroup -Identity "Vendors@TheCrescentTech.com" -HiddenFromExchangeClientsEnabled:$True
hide office 365 group from gal using powershell

This hides the group from Groups section in Exchange clients like OWA.
Hide Office 365 Group from GAL using PowerShell Hide Office 365 Group from GAL using PowerShell Reviewed by Salaudeen Rajack on May 24, 2018 Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.