Exchange混合环境powershell添加具有邮箱的用户



在带有邮箱的prem/o365混合部署中添加用户的最佳方式是什么?如果我在prem或o365上进入Exchange管理中心并添加收件人,它会将其复制到另一个EAC,并在prem上将用户添加到active directory。查看powershell文档,New-Mailbox命令似乎应该这样做,但我无法使其工作。这是我迄今为止所拥有的。

Connect-ExchangeOnline -Credential $credential -ShowProgress $true 
Connect-AzureAD -Credential $credential
Connect-MsolService -Credential $credential
New-Mailbox -MicrosoftOnlineServicesID $uName"@mydomain.com" -Name "$fName $lName" -Password $secureString -ResetPasswordOnNextLogon $true

这会在o365门户中创建邮箱/用户,但不会在on/of-prem-EAC或active directory中创建。

步骤:

  1. 首先创建用户并分配许可证

    "New AD User-Name";用户"-帐户密码(读取主机-AsSecueString"帐户密码"(-启用$true";

  2. 启用远程邮箱

    "启用RemoteMailbox用户-RemoteRoutingAddressuser@domain.mail.onmicrosoft.com">

最新更新