【发布时间】:2022-01-11 15:30:15
【问题描述】:
连接到 Exchange 2016(本地)后,我有以下功能,运行良好:
$username = Read-Host -Prompt "`n Please provide AD-USERNAME to Migrate";
Enable-RemoteMailbox -Identity $username -RemoteRoutingAddress($username+'@MYORG.mail.onmicrosoft.com')
sleep 30
Get-RemoteMailbox $username|Set-RemoteMailbox -EmailAddressPolicyEnabled:$true
我现在需要做的是为每个使用该语法创建的邮箱设置一个新的 smtp 地址。
在不同的脚本中,我使用类似以下的内容来添加额外的 SMTP 并将它们设置为 邮箱的默认值:
Set-RemoteMailbox $username -EmailAddresses @{add="$smtp"}
Set-RemoteMailbox $username -EmailAddressPolicyEnabled $false -PrimarySmtpAddress "$smtp"
不确定,这会以同样的方式在这里工作,amyeb 更像是那种吗?
Get-RemoteMailbox $username| Set-RemoteMailbox $username -EmailAddresses @{add=$username+'@MYORG.com'}
嗯,我不确定从这里到哪里去用语法来做我需要的事情......希望得到一些帮助。
提前谢谢大家!
【问题讨论】:
标签: powershell exchange-server