【问题标题】:New-ExoPSSession : unknown_user_type: Unknown User TypeNew-ExoPSSession:unknown_user_type:未知用户类型
【发布时间】:2021-01-12 01:39:49
【问题描述】:

使用 PowerShell 连接到 Exchange 365 为自定义域设置 DKIM

我对 Office 365 为一堆自定义域设置 DKIM 感到非常沮丧。 我需要使用 PowerShell 登录到 Exchange 系统,并使用只有 Microsoft 可以发明的语法来做一些巫术。

这些是我的资源:

https://docs.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2?view=exchange-ps#install-and-maintain-the-exo-v2-module

https://docs.microsoft.com/en-us/powershell/exchange/connect-to-exchange-online-powershell?view=exchange-ps

安装依赖

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 密钥?

【问题讨论】:

    标签: powershell office365 exchange-server


    【解决方案1】:

    命令在没有ExchangeEnvironmentName 的情况下工作:

    Connect-ExchangeOnline -Credential $UserCredential -ShowProgress $true
    

    所需的用户是user@customdomain.com

    【讨论】:

      【解决方案2】:

      就我而言,我的帐户已启用 MFA。所以有效的命令是:

      Connect-ExchangeOnline -UserPrincipalName navin@contoso.com -ShowProgress $true

      替换您的用户名,并期望使用 Microsoft 身份验证器进行身份验证。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-05-04
        • 2023-04-07
        • 2018-01-02
        • 1970-01-01
        • 2014-04-10
        • 2014-08-17
        • 2020-11-19
        • 1970-01-01
        相关资源
        最近更新 更多