Recipient Filter Syntex

Hi,

I have tried to get a recipient policy going for Exchange 2013 based on database.  Here is the command and error I get"

New-EmailAddressPolicy -Name 'Students' -EnabledPrimarySMTPAddressTemplates "SMTP:%g.%s@students.olin.edu" -Priority '1' -IncludedRecipients MailboxUsers -RecipientFilter { (Database -eq "CN=Students,CN=Databases,CN=Exchange Administrative Group(FYDIBOHF23SPDLT),CN=AdministrativeGroups,CN=OLIN,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=ADroot,DC=local") }

Parameter set cannot be resolved using the specified named parameters.
    + CategoryInfo          : InvalidArgument: (:) [New-EmailAddressPolicy], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,New-EmailAddressPolicy
    + PSComputerName        : ex03.olin.edu

I have tried numerous things and looked around but have yet to determine what is wrong in the syntax above.  Any ideas?

Thanks,

Kurt

August 21st, 2015 2:47pm

According to the documentation:

https://technet.microsoft.com/en-us/library/bb124517%28v=exchg.150%29.aspx?f=255&MSPPError=-2147217396

You can't combine IncludedRecipients and RecipientFilter.  Drop the IncludedRecipients since it's moot, anything with a database is a MailboxUser anyway.

Free Windows Admin Tool Kit Click here and download it now
August 22nd, 2015 7:17pm

Ed,

I took that out and still get the same error:

[PS] C:\Users\milkyway_adm\Desktop>New-EmailAddressPolicy -Name 'Students' -EnabledPrimarySMTPAddressTemplates "SMTP:%g.%s@students.olin.edu" -Priority '1' -RecipientFilt
er { (Database -eq "CN=Students,CN=Databases,CN=Exchange Administrative Group(FYDIBOHF23SPDLT),CN=AdministrativeGroups,CN=OLIN,CN=Microsoft Exchange,CN=Services,CN=Config
uration,DC=ADroot,DC=local") }
Parameter set cannot be resolved using the specified named parameters.
    + CategoryInfo          : InvalidArgument: (:) [New-EmailAddressPolicy], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,New-EmailAddressPolicy
    + PSComputerName        : ex03.olin.edu

Thanks,

Kurt

August 24th, 2015 2:13pm

The syntax looks right.  Are you sure you have the DN correct?  You might try this:

$DN = (Get-MailboxDatabase -Identity Students).DistinguishedName
New-EmailAddressPolicy -Name 'Students' -EnabledPrimarySMTPAddressTemplates "SMTP:%g.%s@students.olin.edu" -Priority '1' -RecipientFilter {(Database -eq $DN)}

Free Windows Admin Tool Kit Click here and download it now
August 25th, 2015 12:40am

Good idea.  However I just tried that and still get the same error.  Would either of these two things be affecting this?  We are running a DAG and we are in co-existence with Exchange 2007.

Thanks, Kurt

New-EmailAddressPolicy -Name 'Students' -EnabledPrimarySMTPAddressTemplates "SMTP:%g.%s@students.olin.edu" -Priority '1' -RecipientFilter {(Database -eq $DN)}
Parameter set cannot be resolved using the specified named parameters.
    + CategoryInfo          : InvalidArgument: (:) [New-EmailAddressPolicy], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,New-EmailAddressPolicy
    + PSComputerName        : ex03.olin.edu

August 25th, 2015 9:21am

Also, if this is supposed to work and the syntax is correct, we need to figure out if this is an issue with a Powershell bug or an actual issue in our environment that is causing this.  I don't suppose someone could run this in a test to verify that it works as intended?  Maybe using the -whatif flag so it doesn't harm anything in your environment.

  • Edited by k2009 16 hours 12 minutes ago
Free Windows Admin Tool Kit Click here and download it now
August 25th, 2015 10:30am

The DAG wouldn't make any difference, nor would I think that coexistence would.  Is the domain you're applying an accepted domain?

August 25th, 2015 11:53am

Looks like there was a syntax error.  -EnabledPrimarySMTPAddressTemplates should not have has the "s" at the end.  That fixed it.

However, although I do see the policy listed in the GUI now, when I go to a mailbox I previously migrated into that database (that got an additional address due to the default recipient policy in Exchange 2013), the recipient policy is not applied.  I have also unchecked the option to apply the email address policy, and then gone back in and reactivated it, and it still inherits the old address.  Is there anything I need to further do to make the policy active? (I did click on Activate in the GUI).

Thanks,

Kurt

Free Windows Admin Tool Kit Click here and download it now
August 25th, 2015 2:52pm

You mean e-mail address policy, not recipient policy.  You're showing your age!  Have you run Update-EmailAddressPolicy?
August 25th, 2015 3:06pm

Yes, I have been doing this for awhile :).

If clicking apply with an email address policy highlighted in the GUI is the same thing as Update-EmailAddressPolicy then yes.  I also just tried it from the shell.

Free Windows Admin Tool Kit Click here and download it now
August 25th, 2015 4:30pm

And there's no e-mail address policy with a higher priority that matches?
August 25th, 2015 5:58pm

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

Other recent topics Other recent topics