create dynamic distribution group exclude disable ids

satya mahapatra 11 Reputation points
2021-07-26T03:19:50.32+00:00

I wan to create one dynamic distribution group and members will be only enable id.
I tried this fail.
any input. we have nybrid configuration with office365

[PS] C:\Windows\system32>Get-DynamicDistributionGroup xyv@jaswant .com | Set-DynamicDistributionGroup -rec
ipientfilter (RecipientType -eq 'UserMailbox') -and (CustomAttribute10 -eq "On-Role") -and (HiddenFromAddressListsEnable
d -eq "False") }
At line:1 char:231

  • ... e10 -eq "On-Role") -and (HiddenFromAddressListsEnabled -eq "False") }
  • ~
    Unexpected token '}' in expression or statement.
  • CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
  • FullyQualifiedErrorId : UnexpectedToken
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,624 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Manu Philip 18,321 Reputation points MVP
    2021-07-26T04:20:18.457+00:00

    Try the following cmdlet

    Get-DynamicDistributionGroup xyv@abc.com | Set-DynamicDistributionGroup -recipientfilter "((RecipientType -eq 'UserMailbox') -and (CustomAttribute10 -eq "On-Role") -and (HiddenFromAddressListsEnabled -eq "False"))"
    
    0 comments No comments

  2. KyleXu-MSFT 26,261 Reputation points
    2021-07-27T02:07:43.713+00:00

    @satya mahapatra

    You need to use '' rather ""

    Set-DynamicDistributionGroup -Identity  xyv@abc.com -RecipientFilter "(RecipientType -eq 'UserMailbox') -and (CustomAttribute10 -eq 'On-Role') -and (HiddenFromAddressListsEnabled -eq 'False')"  
    

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.