locked
enable-mailbox SMTP implementation RRS feed

  • Question

  • Hello,



    I try to create mailbox on my exchange 2013 from powershell.



    I use to do this enable-mailbox but it is not working what I want.



    I have in my AD user with login test.mp and I want to create for him mailbox with e-mail address test.mp@contoso.com.

    But when I use to this enable-mailbox -alias test.mp they create primarySmtp t.mp@contoso.com 



    Can someone say me how to do this?
    • Edited by dr Clays Thursday, October 8, 2020 11:05 AM
    Wednesday, October 7, 2020 1:53 PM

All replies

  • Hello,

    Did you have an address policy strategy enable ? 

    It may modify automatically your primary SMTP email address.

    https://docs.microsoft.com/en-us/exchange/email-addresses-and-address-books/email-address-policies/email-address-policies?view=exchserver-2019

    Wednesday, October 7, 2020 1:55 PM
  • Hi,

    The default setting should be test.mp@contoso.com.

    There may be some customed email address policies in your environment.


    If you would like to change the address manually,please follow these steps:

    1.access EAC

    2.locate recepients-->mailboxes-->target user-->edit-->email address

    3.uncheck the "Automatically update email addresses based on the email address policy applied to this recipient"

    4.add the address test.mp@contoso.com and edit it,select "Make this the reply address"

    5.delete the address t.mp@contoso.com


    In addition,please note that previous Exchange forums on TechNet have been migrated to a new home on Microsoft Q&A and this forum is for Exchange Server Development only.

    It is highly recommended to ask your question there so that there is more chance to get helpful suggestions or answers.

    Regards,

    Kael Yao


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com


    • Edited by Kael Yao Thursday, October 8, 2020 7:57 AM
    Thursday, October 8, 2020 7:57 AM
  • Yes I have it, but I forgot about that.

    Example:
    My AD domain is: domain.local
    External domain: contoso.com
    User: John Smith, SAMA: j.smith

    I use 

    Set-Mailbox -EmailAddressPolicyEnabled $false -PrimarySmtpAddress $primarySmtp

    and it working, but... When I use ECP to create mailbox in propertis in e-mail address exchange make attributes:

    • SMTP: j.smith@contoso.com
    • smtp: j.smith@contoso.com
    • smtp: j.smith@domain.local
    • smtp: j.smith@contoso.mail.onmicrosoft.com
    • x500:/o=ExchangeLabs/ou=Exchange Administrative Group (xxxxxxxxx)/cn=Recipients/cn=xxxxxxx-John Smith

    When I use powershell enable-mailbox with address policy strategy they create mailbox with attributes:

    • SMTP: j.smith@contoso.com
    • smtp: j.smith@contoso.com
    • smtp: j.smith@contoso.mail.onmicrosoft.com

    But here I don't have:

    • smtp:j.smith@domain.local
    • x500:/o=ExchangeLabs/ou=Exchange Administrative Group (xxxxxxxxx)/cn=Recipients/cn=xxxxxxx-John Smith

    And when I create mailbox with:

    Enable-Mailbox -Identity john.smith -Alias john.smith -PrimarySmtpAddress john.smith@contoso.com | Set-Mailbox -EmailAddressPolicyEnabled $false -PrimarySmtpAddress john.smith@contoso.com

    I have in mailbox properties in e-mail address only SMTP, without smtp and x500

    How to add it?

    I have hybrid exchange 2013 and O365



    • Edited by dr Clays Thursday, October 8, 2020 10:29 AM mistake
    Thursday, October 8, 2020 10:26 AM
  • Hello

    When you use the -PrimarySMTPAddress parameter then the account is excluded from the E-mail address policies on powershell.

    Like Kael Yao say. You can try to modify your Address policy. If you can't, try in powershell :

    Enable-Mailbox -Identity john.smith -Alias john.smith

    And after

    Set-Mailbox -Identity john.smith -EmailAddressPolicyEnabled $False

    Set-Mailbox -Identity john.smith -PrimarySmtpAddress john.smith@contoso.com

    You will have x500 and local address with the enable and after set the primary you want 

    Kind regards

    Monday, October 12, 2020 10:23 AM
  • First of all check if you have custom email adress policy on your environment , if so you need to go to EAC find recepients , mailboxes and edit the target user
    Monday, October 12, 2020 12:24 PM
  • Hi,

    Do suggestions above help? If you have any questions or needed further help on this issue, please feel free to post back.


    In addition,please note that previous Exchange forums on TechNet have been migrated to a new home on Microsoft Q&A and this forum is for Exchange Server Development only.

    It is highly recommended to ask your question there so that there is more chance to get helpful suggestions or answers.

    Regards,

    Kael Yao


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Wednesday, October 14, 2020 6:11 AM
  • I find in docs.microsoft about set-mailbox parameter -emailaddresses and this solve my problem.
    Wednesday, October 21, 2020 12:10 PM
  • Glad to hear that your problem has been resolved.

    Thanks for your sharing!

    Regards,

    Kael Yao


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Wednesday, October 21, 2020 11:50 PM