locked
How do Hide Disable Email Addresses for a Group from msExchHideFromAddressLists RRS feed

  • Question

  • Hi All,

    I am looking for power shell command in active directory to hide the disable email addresses for a group from msExchHideFromAddress.

    Before what I have done I make the disable users and theirs disable email address part of one group and as you can see the below command.

    Get-ADUser -Filter 'enabled -eq $false' | select SamAccountName | foreach {Add-ADGroupMember -Identity TestIT -Members $_.samaccountname} 

    And now i wanted to hide this group and their members email addresses from msExchHideFromAddress list.

    Your prompt response will be highly appreciated

    Thanks & Regards,

    Saroop

    Screen shot




    • Edited by Saroop Wednesday, August 9, 2017 9:32 AM
    • Moved by Stanly Fan Thursday, August 10, 2017 6:00 AM from windows form general
    Wednesday, August 9, 2017 8:45 AM

Answers

  • Hi Saroop 

    To hide each member of the group in AD you need to get the group members and do a foreach loop to set the hide from adddress list attriubte. 

    Get-ADGroupMember -Identity "TestIT" | foreach{Set-ADUser $_.samaccountname -Replace @{msExchHideFromAddressLists=$TRUE}}



    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.

    • Marked as answer by Saroop Sunday, August 13, 2017 4:55 AM
    Thursday, August 10, 2017 10:39 PM

All replies

  • Hi Saroop,

    According to your description, your issue is more related about Windows PowerShell. And this forum is discussing and asking questions about the Windows Form and ClickOnce, I will move this thread to corresponding forum: Windows PowerShell Forum for dedicated information.

    Thank you for your understanding.

    Best Regards,

    Stanly


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, August 10, 2017 5:38 AM
  • Hi Stanly,

    Good Day!

    Please you can move the description to their relevant forum.

    How can i help you to move this?

    Regards,

    Saroop

    Thursday, August 10, 2017 5:45 AM
  • Set-DistributionGroup "Group Name" -HiddenFromAddressListsEnabled:$true

    \_(ツ)_/

    Thursday, August 10, 2017 8:17 AM
  • Hi Saroop 

    To hide each member of the group in AD you need to get the group members and do a foreach loop to set the hide from adddress list attriubte. 

    Get-ADGroupMember -Identity "TestIT" | foreach{Set-ADUser $_.samaccountname -Replace @{msExchHideFromAddressLists=$TRUE}}



    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.

    • Marked as answer by Saroop Sunday, August 13, 2017 4:55 AM
    Thursday, August 10, 2017 10:39 PM
  • Hi Geoff,

    Thanks a lot for your help and i got my answer now.

    Thanks & Regards,

    Saroop

    Sunday, August 13, 2017 4:57 AM