[英]Powershell and Exchange - Set SMTP Primary address
I'm in an hybrid environement with Exchange 2016 and Office 365. I wish to script the process to enable a Remote Mailbox, an change the primary SMTP address of a user.我处于 Exchange 2016 和 Office 365 的混合环境中。我希望编写启用远程邮箱的过程脚本,更改用户的主要 SMTP 地址。
By example, I have a user who Remote Mailbox has been enabled.例如,我有一个已启用远程邮箱的用户。 He has a SMTP primary address like this: User1@My-Group.com
他有一个 SMTP 这样的主地址:User1@My-Group.com
With the command below, I can change the SMTP primary address just fine:使用下面的命令,我可以很好地更改 SMTP 主地址:
#Disable Email Address Policy
Set-RemoteMailbox User1 -EmailAddressPolicyEnabled $false
#Change SMTP address
Set-RemoteMailbox User1 -PrimarySmtpAddress "User1@My-good-address.com"
Everything is just fine, when I go to my On Premise Exchange 2016, I can see my user1 addresses like that: SMTP:User1@My-good-address.com smtp:User1@My-Group.com...一切都很好,当我 go 到我的 On Premise Exchange 2016 时,我可以看到我的 user1 地址: SMTP:User1@My-good-address.com smtp:User1@My-Group.com...
But, when I put back Email Address Policy to $True, I have this result on Exchange: SMTP:User1@My-Group.com smtp:User1@My-good-address.com...但是,当我将 Email 地址策略恢复为 $True 时,我在 Exchange 上得到了这个结果:SMTP:User1@My-Group.com smtp:User1@My-good-address.com...
That doesn't happen when I do the change manually.当我手动进行更改时,不会发生这种情况。
Does anyone know why I have this behavior?有谁知道我为什么有这种行为?
Thanks in advance !提前致谢 !
Problem solved... I was just on the ONLY USER who was missing an attribute, and the wrong email policy was applied.问题已解决...我只是在缺少属性的唯一用户上,并且应用了错误的 email 策略。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.