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

Publish date: 2024-05-21

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"

3 Answers

  • First Disconnect-AzureAD from the logged-in session
  • Second UnInstall-Module AzureAD
  • Third Install-Module AzureADPreview
  • Forth connect-AzureAD Then try Get-AzureADPolicy
  • This will work

    2
    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.

    for some reason after installing the module didn't import automatically. After the import-module AzureADPreview it worked for me

    ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJobG1xZWiGc4OOoJytZZGvwrOxwJ2nqKSZmMZuwMeeZK2doqJ6qLHTZpizraKarqW8zqWgnLFdnsBuus6tZKudk6S0r7XZnps%3D