Get-AzureADDirectorySetting not recognized

This article will discuss how to fix the error Get-AzureADDirectorySetting is not recognized.

Get-AzureADDirectorySetting not recognized

Recently, I was trying to execute the Get-AzureADDirectorySetting PowerShell command for one of my client requirement and I got this error.

The complete error message is as below

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

You can check out the same output in the below screenshot.

get-azureaddirectorysetting not recognized

Get-AzureADDirectorySetting not recognized [Solved]

You can follow the below simple steps to fix the error the term ‘get-azureaddirectorysetting’ is not recognized as the name of a cmdlet.

  1. Open Windows PowerShell ISE using Run as Administrator mode.
  2. Execute the below PowerShell command to uninstall the AzureADPreview and AzureAD module.
PS C:windowssystem32> Uninstall-Module AzureADPreview
PS C:windowssystem32> Uninstall-Module azuread

3. Now, execute the below Azure PowerShell command to install the AzureADPreview module.

Install-Module AzureADPreview

After executing the above command, click on the Yes To All button on the below pop-up.

the term 'get-azureaddirectorysetting' is not recognized as the name of a cmdlet

4. Now, you execute the below command, It executed successfully. Check out the screenshot below.

Connect-AzureAD
Get-AzureADDirectorySetting
get-azureaddirectorysetting is not recognized

You may also like following the articles below

Conclusion

This article, discussed how to fix the error get-azureaddirectorysetting is not recognized. Thanks for reading this article !!!