Filter Users for Group using a wildcard

Hi

I'm trying to create a Dynamic group filter using a number from the email address, for example

New-DynamicDistributionGroup -Name "Intake2010" -RecipientFilter {(RecipientType -eq 'MailContact' -and EmailAddresses -like '10*@DomainName.com')} -primarysmtp "Intake2010@Domainname.com" 

the group creates, but is empty

anyone help?

July 15th, 2015 6:49am

Hello

tip: try with: ExternalEmailAddress

Free Windows Admin Tool Kit Click here and download it now
July 15th, 2015 12:49pm

Hi,

First of all, if you want to use EmailAddresses to filter out user, you need to add SMTP: to the RecipientFilter. Like this (EmailAddresses -like 'SMTP:10*@DomainName.com')

And if you want to use this format 10*@DomainName.com' to filter out all emailaddresses like this format? For example, 101@DomainName.com, 102@DomainName.com and 103@DomainName.com will be filtered out. If yes, I would say we cannot filter these email addresses using this format. I suggest to configure some customattributes for these addresses.

If the 10*@DomainName.com is one user mailbox, use the following command to configure the RecipientFilter. One double bracket, one condition.

Set-DynamicDistributionGroup "Intake2010" -RecipientFilter {(RecipientType -eq 'MailContact') -and (EmailAddresses -like '10*@DomainName.com')}

Best Re

July 16th, 2015 3:20am

Hi,

First of all, if you want to use EmailAddresses to filter out user, you need to add SMTP: to the RecipientFilter. Like this (EmailAddresses -like 'SMTP:10*@DomainName.com')

And if you want to use this format 10*@DomainName.com' to filter out all emailaddresses like this format? For example, 101@DomainName.com, 102@DomainName.com and 103@DomainName.com will be filtered out. If yes, I would say we cannot filter these email addresses using this format. I suggest to configure some customattributes for these addresses.

If the 10*@DomainName.com is one user mailbox, use the following command to configure the RecipientFilter. One double bracket, one condition.

Set-DynamicDistributionGroup "Intake2010" -RecipientFilter {(RecipientType -eq 'MailContact') -and (EmailAddresses -like '10*@DomainName.com')}

Best Re

Free Windows Admin Tool Kit Click here and download it now
July 16th, 2015 3:20am

Thanks for the reply lynn..I have tried Adding SMTP: and the group creates but there are still no users within the group.

for example

New-DynamicDistributionGroup -Name "Intake2010" -RecipientFilter {(RecipientType -eq 'UserMailbox') -and (EmailAddresses -like 'SMTP:10*@domainname.com')} -primarysmtp "Intake2011@domainname.com" 

all of  our users ( students) have a year before there email address for example 10jsmith@domainname.com and 11bgates@anotherdomain.com , this will be the year they joined the organisation. 

I have multiple domains ( over 300) and would rather not have to add custom attributes to  these users, i should have mentioned that this is exchange on line as well.



July 16th, 2015 4:30am

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

Other recent topics Other recent topics