gpt4 book ai didi

azure - 获取 AzureADMSPrivilegedRoleAssignment : The term 'Get-AzureADMSPrivilegedRoleAssignment' is not recognized

转载 作者:行者123 更新时间:2023-12-02 08:15:58 25 4
gpt4 key购买 nike

无法在 powershell 中执行 Get-AzureADMSPrivilegedRoleAssignment 它给我一个错误:Get-AzureADMSPrivilegedRoleAssignment:无法识别术语“Get-AzureADMSPrivilegedRoleAssignment”

我尝试安装 AzureADPreview 模块,它说该模块已经存在,但仍然收到此错误。

Get-AzureADMSPrivilegedRoleAssignment : The term 'Get-AzureADMSPrivilegedRoleAssignment' 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-AzureADMSPrivilegedRoleAssignment
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-AzureADMSPrivilegedRoleAssignment:String) [], CommandNotFoundExcept
ion
+ FullyQualifiedErrorId : CommandNotFoundException

任何建议都会有帮助。

最佳答案

Get-AzureADMSPrivilegedRoleAssignment : The term'Get-AzureADMSPrivilegedRoleAssignment' is not recognized as the nameof a cmdlet, function, script file, or operable program.

当您没有 AzureADPreview 时,通常会发生此错误 运行该命令时安装了模块。

我尝试在我的环境中重现相同的情况,但得到了如下相同的错误:

Connect-AzureAD -TenantId <your_tenantID>
Get-Module -Name *AzureAD*
Get-AzureADMSPrivilegedRoleAssignment -ProviderId aadRoles -ResourceId <your_tenantID>

回应:

enter image description here

要解决该错误,您需要安装 AzureADPreview 模块

如果您尝试安装该模块而不删除 AzureAD 模块,您将收到如下错误:

 Install-Module -Name AzureADPreview

回应: enter image description here

要解决此问题,请关闭现有 session 并以管理员身份运行来打开新的PowerShell窗口。

确保卸载 AzureAD 模块并安装 AzureADPreview 模块如下:

Uninstall-Module -Name AzureAD
Install-Module -Name AzureADPreview
Import-Module AzureAD
Connect-AzureAD -TenantId <your_tenantID>
Get-Module *AzureAD*

回应: enter image description here

安装后 AzureADPreview 模块,当我运行以下命令时,我成功得到了响应:

Get-AzureADMSPrivilegedRoleAssignment -ProviderId aadRoles -ResourceId <your_tenantID>

回应:

enter image description here

关于azure - 获取 AzureADMSPrivilegedRoleAssignment : The term 'Get-AzureADMSPrivilegedRoleAssignment' is not recognized,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73804622/

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