简体   繁体   English

Powershell 和 Exchange - 设置 SMTP 主地址

[英]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.

相关问题 Exchange Powershell-批量向所有邮箱用户添加新的SMTP地址 - Exchange Powershell - Bulk add new SMTP address to all mailbox users 从名称列表中获取SMTP地址(Exchange 2013 powershell) - Get SMTP address from a list of Names (Exchange 2013 powershell) 列出特定Exchange数据库的所有(组)邮箱以及主要SMTP表示的所有权限的Powershell脚本 - Powershell script that lists all (group)mailboxes of a certain exchange Database and all permissions expressed by primary SMTP 使用 Powershell 启用 Exchange Online SMTP 客户端身份验证 - Enabling Exchange Online SMTP Client Authentication with Powershell PowerShell脚本的MS Exchange Server SMTP名称 - MS Exchange Server SMTP name for PowerShell script 从主 email 地址中删除 SMTP: - Remove SMTP: from primary email address 从代理地址 powershell 获取主 SMTP - get primary SMTP from Proxyaddresses powershell PowerShell获取用户的电子邮件地址进行交换 - PowerShell Get Users Email Address To Exchange Powershell,使用“里程”字段发送SMTP电子邮件(Microsoft Exchange) - Powershell, Send SMTP email with 'Mileage' field (Microsoft Exchange) 查找所有以“ @ SMTP.com”结尾的“主SMTP地址”的用户 - Find all users with a 'Primary SMTP address' that ends with '@example.com'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM