exchange address policies - edit the default policy

ppinfrageek 121 Reputation points
2021-01-07T10:28:54.223+00:00

I would like to either configure a new address policy for migrated users or edit the default policy - any assistance much appreciated.

Our exchange 2013 address policies use a custom policy with priority 3 for our domain, and that applies to local users with exchange mailboxes, resource mailboxes and mail-enabled groups.
When a user is migrated to office 365 however, they appear in Exchange 2013 (full-hybrid) as "office 365" mailbox type and that is no longer matched to that policy above and instead, the "Default Policy" applies. The problem is that policy is no in use or accurate and contains invalid domain etc.

How can I edit the default policy? Is this a good practice?
Set-EmailAddressPolicy -Identity “Default Policy” -EnabledEmailAddressTemplates SMTP:%m@ourcorrectdomain.com

Alternatively, how can I create a new policy with narrow scope to apply only to migrated users to office 365? I cannot use OU :(

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,250 questions
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,390 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,914 questions
{count} votes

Accepted answer
  1. Andy David - MVP 142.7K Reputation points MVP
    2021-01-07T13:37:05.55+00:00

    365 Mailboxes from an on-prem perspective EAC are considered MailUsers.

    You can filter on that with a new policy.

    https://learn.microsoft.com/en-us/powershell/module/exchange/new-emailaddresspolicy?view=exchange-ps

    -IncludedRecipients
    This parameter is available only in on-premises Exchange.

    The IncludedRecipients parameter specifies a precanned filter that's based on the recipient type. Valid values are:

    AllRecipients: This value can be used only by itself.
    MailboxUsers
    MailContacts
    MailGroups
    MailUsers
    Resources: This value indicates room or equipment mailboxes.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. ppinfrageek 121 Reputation points
    2021-01-07T13:29:14.923+00:00

    it would have been ideal to be able to create a policy that only applies to migrated users (mailbox type Office 365) - the default policy applies to all so that will change all to .com primary and we appear to have users with .co.uk primary etc.

    Is that at all possible?

    0 comments No comments

  2. ppinfrageek 121 Reputation points
    2021-01-07T15:23:29.463+00:00

    Thanks for that,

    I tried creating a separate policy, but could not get the syntax right - any idea what I am doing wrong?

    New-EmailAddressPolicy -Name "MigratedUsers to o365" –RecipientFilter "(RecipientType –eq 'MailUser') -and (ExternalEmailAddress -like '*ourcorrectdomain.mail.onmicrosoft.com')" -EnabledEmailAddressTemplates "SMTP:%m@ourcorrectdomain.com" -Priority 1

    Cannot bind parameter 'RecipientFilter' to the target. Exception setting "RecipientFilter": "Invalid filter syntax.
    For a description of the filter parameter syntax see the command help.
    "(RecipientType -eq 'MailUser') -and (ExternalEmailAddress -like '*ourcorrectdomain.mail.onmicrosoft.com')" at position 17."

    • CategoryInfo : WriteError: (:) [New-EmailAddressPolicy], ParameterBindingException
    • FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.Exchange.Management.SystemConfigurationTasks.NewEmailAd
      dressPolicy