当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 无法识别术语 Get-OrganizationConfig

作者:精品下载站 日期:2024-12-14 18:40:14 浏览:13 分类:玩电脑

无法识别术语 Get-OrganizationConfig


您想要运行混合配置向导,因为您需要将一些更改推送到 Office 365。在执行向导并连接到 Office 365 时,会出现以下错误:命令无法识别。请验证您的帐户分配了正确的管理角色。发生了什么情况,解决方案是什么?

请验证您的帐户分配了正确的管理角色

运行混合配置向导并完成这些步骤。当我们到达填写本地 Exchange 管理员帐户凭据和 Office 365 租户管理员帐户的屏幕时,我们单击“下一步”。

[玩转系统] 无法识别术语 Get-OrganizationConfig

它将收集两个帐户的信息并连接到本地 Exchange 和 Exchange Online。但是,它可以成功连接到本地 Exchange,但无法连接到 Office 365。

错误显示:

命令无法识别。请验证您的帐户分配了正确的管理角色。

[玩转系统] 无法识别术语 Get-OrganizationConfig

检查 Exchange 混合配置日志

让我们看一下 Exchange 混合配置日志。

启动文件资源管理器并转到以下位置:

%UserProfile%\AppData\Roaming\Microsoft\Exchange Hybrid Configuration

修改日期排序。

[玩转系统] 无法识别术语 Get-OrganizationConfig

打开包含上次修改日期的日志并向下滚动到底部。

[玩转系统] 无法识别术语 Get-OrganizationConfig

日志中的文本很难看到,但复制并显示在下面。

2022.07.31 07:58:27.136         10084 [Client=UX, Activity=Tenant Connection Validation, Thread=11] Getting configuration data...
2022.07.31 07:58:27.246         10258 [Client=UX, Activity=Tenant Data Retrieval, Thread=11] START 
2022.07.31 07:58:27.247         10276 [Client=UX, Activity=Tenant Connection Validation, Session=Tenant, Cmdlet=Get-OrganizationConfig, Thread=11] START 
2022.07.31 07:58:27.947 *ERROR* 10277 [Client=UX, Activity=Tenant Connection Validation, Session=Tenant, Cmdlet=Get-OrganizationConfig, Thread=11] FINISH Time=700,0ms Results=Command not recognized.  Please verify you have the correct Management Role assigned to your account.
2022.07.31 07:58:27.947 *ERROR* 10085 [Client=UX, Activity=Tenant Connection Validation, Thread=11] Command not recognized.  Please verify you have the correct Management Role assigned to your account.
2022.07.31 07:58:27.948         10084 [Client=UX, Activity=Tenant Connection Validation, Thread=11] Command not recognized.  Please verify you have the correct Management Role assigned to your account.
2022.07.31 07:58:27.949         10275 [Client=UX, Activity=Tenant Connection Validation, Thread=11] FINISH Time=4267,0ms
2022.07.31 07:58:27.949 WARNING 10079 [Client=UX, Activity=Tenant Connection Validation, Thread=11] Command not recognized.  Please verify you have the correct Management Role assigned to your account.

该错误表明混合配置向导确实在云中运行了 Get-OrganizationConfig cmdlet。但是,该命令未被识别。

无法识别 Get-OrganizationConfig 命令

让我们重现上述错误,看看在 Exchange Online 中手动运行命令时是否会遇到相同的错误。

以管理员身份启动 Windows PowerShell 并连接到 Exchange Online PowerShell。

PS C:\> Connect-ExchangeOnline

运行获取组织配置 cmdlet。

PS C:\> Get-OrganizationConfig

输出显示术语 Get-OrganizationConfig 未被识别为 cmdlet、函数、脚本文件或可操作程序的名称

Get-OrganizationConfig : The term 'Get-OrganizationConfig' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:1
+ Get-OrganizationConfig
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-OrganizationConfig:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Get-OrganizationConfig命令无法识别的解决方法

现在我们无法运行 Get-OrganizationConfig cmdlet,让我们看看解决方案并将管理员帐户添加到合规管理组。

使用 PowerShell 将帐户分配给合规性管理角色

要使用 PowerShell 将管理员帐户分配给合规性管理角色组,请运行 Update-RoleGroupMember cmdlet。

PS C:\> Update-RoleGroupMember -Identity "Compliance Management" -Members "[email protected]"

将帐户分配给 Microsoft 365 管理中心中的合规性管理角色

要将管理员帐户分配给 Microsoft 365 管理中心中的合规性管理角色组,请按照以下步骤操作:

  • 登录 Microsoft 365 管理中心

  • 展开角色并单击角色分配

  • 点击顶部栏中的交换

  • 从列表中选择合规管理

[玩转系统] 无法识别术语 Get-OrganizationConfig

  • 点击顶部栏中的已分配

  • 添加管理员帐户

[玩转系统] 无法识别术语 Get-OrganizationConfig

验证 Get-OrganizationConfig 是否有效

让我们验证 Get-OrganizationConfig cmdlet 是否有效。之后,重新运行混合配置向导并检查其是否连接成功。

注意:等待一个小时,然后再尝试运行 Get-OrganizationConfig cmdlet。这是因为在微软云服务器中传播这些变化需要时间。

1. 运行 Disconnect-ExchangeOnline cmdlet 并关闭 PowerShell 窗口。

PS C:\> Disconnect-ExchangeOnline

2. 以管理员身份启动 Windows PowerShell 并连接到 Exchange Online PowerShell。

3. 运行 Get-OrganizationConfig cmdlet。

PS C:\> Get-OrganizationConfig

这次成功了,输出了 Exchange Online 组织配置数据。

4. 关闭混合配置向导并再次运行。

[玩转系统] 无法识别术语 Get-OrganizationConfig

这次使用管理员帐户凭据连接到 Office 365 时将会成功。

了解更多:混合配置向导无法连接 »

结论

您了解了为什么命令 Get-OrganizationConfig 无法识别。此问题的解决方案是将管理员帐户添加到合规性管理角色组。之后,您可以在 PowerShell 中运行命令 Get-OrganizationConfig 并获取信息或重新运行混合配置向导并继续操作。

您喜欢这篇文章吗?您可能还喜欢内容搜索中的导出结果错误。不要忘记关注我们并分享这篇文章。

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯