This article will discuss how to fix the error Get-AzureADDirectorySetting is not recognized.
Table of Contents
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 : CommandNotFoundExceptionYou can check out the same output in the below screenshot.

Solution
You can follow the below simple steps to fix the error the term ‘get-azureaddirectorysetting’ is not recognized as the name of a cmdlet.
- Open Windows PowerShell ISE using Run as Administrator mode.
- Execute the below PowerShell command to uninstall the AzureADPreview and AzureAD module.
PS C:windowssystem32> Uninstall-Module AzureADPreview
PS C:windowssystem32> Uninstall-Module azuread3. Now, execute the below Azure PowerShell command to install the AzureADPreview module.
Install-Module AzureADPreviewAfter executing the above command, click on the Yes To All button on the below pop-up.

4. Now, you execute the below command, It executed successfully. Check out the screenshot below.
Connect-AzureAD
Get-AzureADDirectorySetting
You may also like the following articles below
Conclusion
This article, discussed how to fix the error get-azureaddirectorysetting is not recognized. Thanks for reading this article !!!

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
