Skip to content

Hide mail-enabled security group from GAL with PowerShell

You like to hide the mail-enabled security group from the Global Address List (GAL). The organization does not want to see the security group in the GAL. In this article, you will learn how to hide mail-enabled security groups from GAL with PowerShell.

Get hide mail-enabled security group information

The organization does have a mail-enabled security group named Finance. They asked if the group can be hidden from the address list. Run Exchange Management Shell as administrator. Let’s find out if the security group is hidden or not. We are going to make use of the Get-DistributionGroup cmdlet.

[PS] C:\>Get-DistributionGroup -RecipientTypeDetails MailUniversalSecurityGroup -Identity "Finance" | Format-Table Name, HiddenFromAddressListsEnabled

Name    HiddenFromAddressListsEnabled
----    -----------------------------
Finance                         False

The output is showing as False. This means that the Finance group is showing in the GAL and it’s not hidden. In the next part, we will hide the Finance group from the address list.

Hide mail-enabled security group from GAL with PowerShell

Set the distribution group Finance to hide from the address list. We are going to make use of the Set-DistributionGroup cmdlet.

[PS] C:\>Get-DistributionGroup -RecipientTypeDetails MailUniversalSecurityGroup -Identity "Finance" | Set-DistributionGroup -HiddenFromAddressListsEnabled:$true

Verify the changes

It’s always good to verify the results after a change. The output should show the value as True.

[PS] C:\>Get-DistributionGroup -RecipientTypeDetails MailUniversalSecurityGroup -Identity "Finance" | Format-Table Name, HiddenFromAddressListsEnabled

Name    HiddenFromAddressListsEnabled
----    -----------------------------
Finance                          True

Change the distribution group Finance back to hidden in GAL by changing the value true to false.

Get hide mail-enabled security groups in OU information

What if you have more then one mail-enabled security group and you want to set it to hidden from GAL. Get all the mail universal security groups in the Organization Unit (OU). In our example, we are going to use the OU named Mailbox and sort the distribution groups on Name.

[PS] C:\>Get-DistributionGroup Resultsize Unlimited -RecipientTypeDetails MailUniversalSecurityGroup -OrganizationalUnit "alitajran.local/Groups/Mailbox" | Sort-Object Name | Format-Table Name, GroupType, Hidden*

Name                     GroupType HiddenFromAddressListsEnabled
----                     --------- -----------------------------
Finance Universal, SecurityEnabled                         False
GDPR    Universal, SecurityEnabled                         False
HR      Universal, SecurityEnabled                         False
Orders  Universal, SecurityEnabled                         False

Hide mail-enabled security groups in OU from GAL with PowerShell

Set the distribution groups in the OU to hidden from GAL.

[PS] C:\>Get-DistributionGroup -Resultsize Unlimited -OrganizationalUnit "alitajran.local/Groups/Mailbox" | Set-DistributionGroup -HiddenFromAddressListsEnabled:$true

Verify the changes

It’s always good to verify the results after a change. The output should show the value as True.

[PS] C:\>Get-DistributionGroup -Resultsize Unlimited -RecipientTypeDetails MailUniversalSecurityGroup -OrganizationalUnit "alitajran.local/Groups/Mailbox" | Sort-Object Name | Format-Table Name, GroupType, Hidden*

Name                     GroupType HiddenFromAddressListsEnabled
----                     --------- -----------------------------
Finance Universal, SecurityEnabled                          True
GDPR    Universal, SecurityEnabled                          True
HR      Universal, SecurityEnabled                          True
Orders  Universal, SecurityEnabled                          True

Conclusion

To sum it up, you did learn how to hide a mail-enabled security group from GAL with PowerShell. If you want to hide one group or more groups, it’s possible with PowerShell. Did you enjoy this article? If so, you may like Check Exchange Schema version with PowerShell. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *