Office 365: How to hide an Office 365 Group from the GAL!

If you need to hide an Office 365 from the GAL (Global Address List), you only need to execute the following PowerShell Script:

$sUserName="<AdminUser>@<Office365Domain>"
$sMessage="Introduce your O365 Credentials"
$Cred=Get-Credential -UserName $sUserName -Message $sMessage
#Create an EXO PS Session
$PSSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Cred -Authentication Basic -AllowRedirection

Import-PSSession $PSSession
$sDistributionGroupName="<GroupName>"
$DistributionGroup=Get-UnifiedGroup -Identity $sDistributionGroupName
Set-UnifiedGroup -Identity $DistributionGroup.Id -HiddenFromAddressListsEnabled $true

Once you execute above script, the Office 365 Group will not appear in the GAL.

Anuncios

Office 365: Como ocultar un Grupo de Office 365 de la GAL (I)!

Ocultar un Grupo de Office 365 de la GAL (Global Address List) es una tarea que se puede conseguir de forma muy sencilla mediante el siguiente script PowerShell:

$sUserName="<AdminUser>@<Office365Domain>"
$sMessage="Introduce your O365 Credentials"
$Cred=Get-Credential -UserName $sUserName -Message $sMessage
#Create an EXO PS Session
$PSSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Cred -Authentication Basic -AllowRedirection

Import-PSSession $PSSession
$sDistributionGroupName="<GroupName>"
$DistributionGroup=Get-UnifiedGroup -Identity $sDistributionGroupName
Set-UnifiedGroup -Identity $DistributionGroup.Id -HiddenFromAddressListsEnabled $true

Tras ejecutar el script, el Grupo de Office 365 no aparecerá más en la GAL.