Powershell交换模块远程邮箱问题

标签 powershell azure active-directory exchange-server office365

我创建了一个脚本,可以自动在 Exchange 中创建用户,然后从 o365 向其添加许可证,但是我需要底部的框,其中显示“根据应用于此收件人的电子邮件地址策略自动更新电子邮件地址” "在创建帐户时自动勾选。

enter image description here

这是创建远程邮箱的主要组件:

New-RemoteMailBox -Alias $identAlias -Name $name -FirstName $return[0] -LastName $return[1] -UserPrincipalName $eAddress  -Password (ConvertTo-SecureString -String 'xxxxxxx' -AsPlainText -Force) -ResetPasswordOnNextLogon $true 

请帮忙!

最佳答案

申请all users

Get-mailbox | Set-mailbox -EmailAddressPolicyEnabled $true

并按域进行限制

Get-mailbox | Where {$_.EmailAddresses -like ‘*@domain.com’} |
 Set-mailbox -EmailAddressPolicyEnabled $true

远程

Get-mailbox | Where {$_.EmailAddresses -like ‘*@domain.com’} |
Set-RemoteMailbox EmailAddressPolicyEnabled

关于Powershell交换模块远程邮箱问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30280768/

相关文章:

c# - 尝试连接到 Azure Web App 时出现授权错误

c# - 如何通过表单在 ASP.NET Web API 中实现 Active Directory 身份验证?

使用 Windows Azure AD 进行 iOS 应用程序身份验证

c# - 什么是 PowerShell.Telemetry.ApplicationInsightsTelemetry?我可以将其关闭吗?

windows - PowerShell Write-Output、echo 和输出重定向将过多的字符插入到输出中

azure - 使用 Microsoft Azure Face API 人员组

javascript - 调整从事件目录中提取的照片的大小

powershell - VSC 在运行 powershell 脚本时抛出错误

powershell - 将测试路径输出重定向到文本文件

node.js - Windows Azure 上的 nowJS