powershell - New-ExoPSSession:unknown_user_type:未知用户类型
问题描述
使用 PowerShell 连接到 Exchange 365 为自定义域设置 DKIM
我对 Office 365 为一堆自定义域设置 DKIM 感到非常沮丧。我需要使用 PowerShell 登录到 Exchange 系统,并使用只有 Microsoft 可以发明的语法做一些巫术。
这些是我的资源:
安装依赖
Install-Module -Name ExchangeOnlineManagement -RequiredVersion 2.0.3
Set-ExecutionPolicy RemoteSigned
Import-Module ExchangeOnlineManagement
我对所有问题的回答都是肯定的,这似乎有效。
在登录
$UserCredential = Get-Credential
我被要求提供我的管理员凭据,我在表单中输入它们,user@cortoso.onmicrosoft.com
我也尝试了user@customdomain.com
。当我通过 Microsoft 门户网站登录到 Exchange 管理员时,两者都可以工作。
下一个命令失败:
Connect-ExchangeOnline -Credential $UserCredential -ShowProgress $true -ExchangeEnvironmentName O365GermanyCloud
----------------------------------------------------------------------------
The module allows access to all existing remote PowerShell (V1) cmdlets in addition to the 9 new, faster, and more reliable cmdlets.
|--------------------------------------------------------------------------|
| Old Cmdlets | New/Reliable/Faster Cmdlets |
|--------------------------------------------------------------------------|
| Get-CASMailbox | Get-EXOCASMailbox |
| Get-Mailbox | Get-EXOMailbox |
| Get-MailboxFolderPermission | Get-EXOMailboxFolderPermission |
| Get-MailboxFolderStatistics | Get-EXOMailboxFolderStatistics |
| Get-MailboxPermission | Get-EXOMailboxPermission |
| Get-MailboxStatistics | Get-EXOMailboxStatistics |
| Get-MobileDeviceStatistics | Get-EXOMobileDeviceStatistics |
| Get-Recipient | Get-EXORecipient |
| Get-RecipientPermission | Get-EXORecipientPermission |
|--------------------------------------------------------------------------|
To get additional information, run: Get-Help Connect-ExchangeOnline or check https://aka.ms/exops-docs
Send your product improvement suggestions and feedback to <cut>. For issues related to the module, contact Microsoft support. Don't use the feedback alias for problems or support issues.
----------------------------------------------------------------------------
New-ExoPSSession : unknown_user_type: Unknown User Type.
In C:\Program Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\2.0.3\ExchangeOnlineManagement.psm1:426 Zeichen:30
+ ... PSSession = New-ExoPSSession -ExchangeEnvironmentName $ExchangeEnviro ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-ExoPSSession], Exception
+ FullyQualifiedErrorId : System.Exception,Microsoft.Exchange.Management.ExoPowershellSnapin.NewExoPSSession
如何继续登录 Exchange 以设置 DKIM 密钥?
解决方案
命令在没有ExchangeEnvironmentName
:
Connect-ExchangeOnline -Credential $UserCredential -ShowProgress $true
所需的用户是user@customdomain.com
.
推荐阅读
- sql - Django:如何只更新数据库中的一条记录?
- coordinates - 在xarray中交换纬度和经度位置
- regex - 解析 Rest 查询输出
- html - CSS:page-break-inside:避免在表格行中不起作用
- python - 使用 Redis 进行 Django 缓存
- sql - PostgreSQL:如何阅读并行解释分析(行与单线程不匹配)
- regex - 如何使用 cypress 和 RegEx 获取当前 URL 的一部分
- sql - 有没有办法在 CASE - WHEN 在 oracle 中添加语句
- javascript - jQuery:使用多个下拉菜单时获取(1)选定的值
- llvm - 如何在 LLVM IR 中创建字符串