Creating Dynamc Distribution List using RecipientFilter -like

Data

  • Identity: User1, CustomAttribute1: aa
  • Identity: User2, CustomAttribute1: aa bb
  • Identity: User3, CustomAttribute1: aa bb cc
  • Identity: User4, CustomAttribute1: bb cc
  • Identity: User5, CustomAttribute1: cc

Above is the data available in my domain. I would like to create a Dynamic Distribution Group to select the users with the CustomAttribute1 contain bb.

I created below Dynamic Distribution Group but no result returned.

New-DynamicDistributionGroup -Name "bb" -RecipientFilter (CustomAttribute1 -like 'bb')

Please help.

Thanks.

  • Moved by Bill_Stewart Wednesday, May 20, 2015 12:47 PM Move to more appropriate forum
May 12th, 2015 9:29am

You need to surround the b's with wildcards 

New-DynamicDistributionGroup -Name "bb" -RecipientFilter (CustomAttribute1 -like '*bb*')

Free Windows Admin Tool Kit Click here and download it now
May 12th, 2015 9:42am

Tried before and it show me error as below.

Wildcards cannot be used as the first character. Please revise the filter.

After I remove the first wildcard, it also did not show me the expected answer.

May 12th, 2015 9:52am

Hmm, it should be a perfectly valid filter... Try this

New-DynamicDistributionGroup -Name "bb" -RecipientFilter {(CustomAttribute1 -like '*bb*')}

Free Windows Admin Tool Kit Click here and download it now
May 12th, 2015 10:24am

This is a limitation of using overloaded attributes.  Use separate attributes for separate tags.
May 12th, 2015 11:22am

Giving me the same error message.
Free Windows Admin Tool Kit Click here and download it now
May 13th, 2015 2:56am

Hmm, it should be a perfectly valid filter... Try this

New-DynamicDistributionGroup -Name "bb" -RecipientFilter {(CustomAttribute1 -like '*bb*')}

Giving me the same error message
May 20th, 2015 2:52am

Hi,

What's your Exchange version? I tested with the same configuration in my Exchange 2013 environment. I can create a Dynamic Distribution Group with the following command correctly:

New-DynamicDistributionGroup -Name "bb" -RecipientFilter {CustomAttribute1 -like '*bb*'}

Please make sure the CustomAttribute1 is set correctly for these user. Also check whether User2, User3, User4 can be filtered with the followng command:

Get-Mailbox | Where { $_.CustomAttribute1 -like '*bb*'} 

Regards,

Free Windows Admin Tool Kit Click here and download it now
May 26th, 2015 5:08am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics