gpt4 book ai didi

powershell - 新的 ExoPSSession : unknown_user_type: Unknown User Type

转载 作者:行者123 更新时间:2023-12-04 15:17:22 33 4
gpt4 key购买 nike

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

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

这些是我的资源:

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

https://learn.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 key ?

最佳答案

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

Connect-ExchangeOnline -Credential $UserCredential -ShowProgress $true

所需的用户是 user@customdomain.com

关于powershell - 新的 ExoPSSession : unknown_user_type: Unknown User Type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64068859/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com