Set AD attribute msExchHideFromAddressLists to TRUE

Ingrid 61 Reputation points
2022-07-07T11:51:33.903+00:00

Sorry for posting another question.
I want to hide the mailbox for one specific user in the GAL.
I know how to do this on the exchange server, but I noticed in AD there is an attribute msExchHideFromAddressLists that is set to TRUE when you hide the account.

I want to use powershell to hide the mailbox, but cannot for the live of it find out how to change this to TRUE.

I am able to retrieve the status by running Get-ADuser -Identity username -property msExchHideFromAddressLists.
When using the Set-ADuser how can I set this attribute to true?

Might be a simple question, but I am having a brainfreeze here.

Thanks again

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
5,898 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,357 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,381 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rich Matheisen 45,091 Reputation points
    2022-07-07T14:46:48.29+00:00

    Do you have the Exchange management tools installed on your machine?

    Set-Mailbox -Identity <mailboxID> -HiddenFromAddressListsEnabled:$true  
    
    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Newbie Jones 1,306 Reputation points
    2022-07-07T14:12:29.873+00:00
        Get-ADuser -Identity username -property msExchHideFromAddressLists |  
        Set-ADObject -Replace @{msExchHideFromAddressLists=$true}  
    

    Advantage of Set-ADObject is that you can use this with users, group or contact.

    2 people found this answer helpful.