无法使用已安装的 AzureAD 模块执行 Connet-AzureAD

问题描述 投票:0回答:2

我已经在我的 Powershell 版本 7 中安装了 AzureAD 模块,但是我无法执行 Connect-AzureAD Cmdlet。

有什么想法吗?

PS C:\Users\User> Get-InstalledModule

Version              Name                                Repository           Description
-------              ----                                ----------           -----------
2.0.2.135            AzureAD                             PSGallery            Azure Active Directory V2 Gene…

PS C:\Users\User> Connect-AzureAD
Connect-AzureAD: The term 'Connect-AzureAD' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
azure powershell azure-powershell
2个回答
0
投票

(旧版)“AzureAD”、“AzureADPreview”和“MSOnline”PowerShell 模块仅适用于 Windows PowerShell(即 Windows PowerShell 5.1 或更早版本

如果你想使用跨平台的PowerShell版本(比如PowerShell 7+),那么你需要使用现代的Microsoft Graph模块比如:


0
投票

你导入模块了吗?

Import-Module AzureAD

如果您尝试对 AzureADPreview 执行相同操作,请按照本文操作: Get-AzureADMSPrivilegedRoleAssignment:无法识别术语“Get-AzureADMSPrivilegedRoleAssignment”

© www.soinside.com 2019 - 2024. All rights reserved.