Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get-AzureADPolicy : The term 'Get-AzureADPolicy' is not recognized

After connecting to Azure AD with Connect-AzureAD , If run the command Get-AzureADPolicy, PowerShell is prompting the message as "Get-AzureADPolicy : The term 'Get-AzureADPolicy' is not recognized"

like image 344
Ravikiran Reddy Kotapati Avatar asked Mar 02 '19 00:03

Ravikiran Reddy Kotapati


2 Answers

  1. First Disconnect-AzureAD from the logged-in session
  2. Second UnInstall-Module AzureAD
  3. Third Install-Module AzureADPreview
  4. Forth connect-AzureAD Then try Get-AzureADPolicy

This will work

like image 171
Ravikiran Reddy Kotapati Avatar answered Sep 30 '22 02:09

Ravikiran Reddy Kotapati


Install-Module AzureADPreview

failed to install at first. Then I have installed AzureAD:

Install-Module AzureAD

The Get-AzureADPolicy was still missing, so I tried to install AzureADPreview again (without removing AzureAD).

Install-Module AzureADPreview

This time it proceeded where it has failed previously. Adding the -AllowClobber argument fixed the installation problem.

Install-Module AzureADPreview -AllowClobber

Restarted Powershell and Get-AzureADPolicy worked.

like image 31
Zsolti Avatar answered Sep 30 '22 03:09

Zsolti