msExchHideFromAddressLists

How to configure msExchHideFromAddressLists

msExchHideFromAddressLists is an attribute in Active Directory (AD) used on users, groups, and contacts to control visibility in address lists.

To configure this attribute using PowerShell I suggest using the ActiveDirectory Module for PowerShell. This module is part of RSAT (Remote Server Administration Tools) which you need to activate (or download depending on your OS version). The module is available on domain controllers by default.

The msExchHideFromAddressLists attribute is a nullable boolean, meaning you can only set it to true or false (or null).

Later we’ll look at how to configure it via the various GUI tools, but for now, let’s have a look at PowerShell.

Configure msExchHideFromAddressLists Using PowerShell

There are different ways to configure this attribute depending on what object type you’re setting it for.

The most generic approach using the AD PowerShell module would be to use the following command:

Set-ADObject "CN=Marketing,OU=GigaCorp_Groups,DC=gigacorp,DC=local" -Replace @{msExchHideFromAddressLists=$false}

The advantage of using Set-ADObject is that you can use it for any type of object. For example, you can run this command against a user, a group or a contact object.

The potential problem using Set-ADObject is that the identity must be either the distinguishedName (as seen in the above example) or the objectGUID.

If you only remember the sAMAccountName attribute, you can still use Set-ADObject with this small workaround:

Get-ADObject -LDAPFilter "(sAMAccountName=Marketing)" | Set-ADObject -replace @{msExchHideFromAddressLists=$false}

If you want to take an object-specific approach, you can use Set-ADUser or Set-ADGroup. Both of these commands will accept sAMAccountName as identity parameter:

Set-ADGroup Marketing -Replace @{msExchHideFromAddressLists=$false}

Finally, to clear (null) the value from the msExchHideFromAddressLists attribute, use the following command:

Set-ADGroup Marketing -Clear msExchHideFromAddressLists

Configuring msExchHideFromAddressLists with GUI tools

I hope the above code snippets cover your needs in terms of configuring the msExchHideFromAddressLists attribute.

For some daily configuration tasks, it’s often more convenient to use a graphical user interface (GUI). You have various options to configure the msExchHideFromAddressLists attribute using a GUI:

Easy365Manager

By far, the easiest way to configure msExchHideFromAddressLists (and any other AD mail attributes, for that matter) is using Easy365Manager.

With Easy365Manager, you don’t have to switch between multiple admin tools: Everything is possible in the AD Users & Computers tool due to the extra tabs on user and group properties.

To modify the msExchHideFromAddressLists for a group, open up group properties and go to the Office 365 tab:

To see a complete list of features for Easy365Manager, have a look at this.

Did you like this post? Maybe your friends will too!