Share via

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 | Exchange Server | Management
Exchange | Exchange Server | Management

The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.


2 answers

Sort by: Most helpful
  1. KyleXu-MSFT 26,406 Reputation points
    2021-07-27T02:07:43.713+00:00

    @satya mahapatra

    You need to use '' rather ""

    Set-DynamicDistributionGroup -Identity  ******@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.

    Was this answer helpful?

    0 comments No comments

  2. Manu Philip 20,651 Reputation points MVP Volunteer Moderator
    2021-07-26T04:20:18.457+00:00

    Try the following cmdlet

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

    Was this answer helpful?

    0 comments No comments

Your answer

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