In this post I will show you how to hide/unhide a distribution group from Global Address List(GAL) using powershell.
Powershell module for Exchange 2010 module has two cmdlets that helps in querying and setting the hide from address list option on distribution groups. They are “Get-DistributionGroup” and “Set-DistributionGroup“. The visibility status of a distribution group decided based on a Property called “HiddenFromAddressListsEnabled”. We can query this property by using Get-DistributionGroup cmdlet. See below for example.
Get-DistributionGroup -Id "mygroup1" | select HiddenFromAddressListsEnabled
The distribution group is configured to be hidden from GAL if the value of HiddenFromAddressListsEnabled is $true. Otherwise it will be visible in GAL.
We can hide a distribution group by setting the value of this parameter to $true. See below for example
Set-DistributionGroup -Id "mygroup1" -HiddenFromAddressListsEnabled:$true
Hope this helps
Comments on this entry are closed.
Except that doesn’t work because you didn’t correctly list the attribute. It is HiddenFromAddressListsEnabled.
Not Hide….
Thanks for saving me some time with this one.
Good catch Michael! Would’ve taken a while to figure that one out, if you hadn’t mentioned it.