The term ‘Get-AzureADDirectorySettingTemplate’ is not recognized as the name of a cmdlet

In this azure tutorial, we will discuss how to fix the error, The term ‘Get-AzureADDirectorySettingTemplate’ 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.
 

which comes while trying to execute the Get-AzureADDirectorySettingTemplate using PowerShell ISE inĀ Azure.

The term ‘Get-AzureADDirectorySettingTemplate’ is not recognized as the name of a cmdlet

Recently, while executing the command Get-AzureADDirectorySettingTemplate to get the list of all settings templates.

PS C:windowssystem32> Get-AzureADDirectorySettingTemplate

See here

The term 'Get-AzureADDirectorySettingTemplate' is not recognized as the name of a cmdlet

The exact error message is as below

Get-AzureADDirectorySettingTemplate : The term ‘Get-AzureADDirectorySettingTemplate’ 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-AzureADDirectorySettingTemplate
  • ~~~~~~~
    • CategoryInfo : ObjectNotFound: (Get-AzureADDirectorySettingTemplate:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

To fix this error you need to follow the below steps:

Step-1:

Open the Windows PowerShell or PowerShell ISE app as an administrator.

Step-2:

Uninstall your previous versions of AzureAD or AzureADPreview. Use the below command in your Windows PowerShell or PowerShell ISE window.

PS C:windowssystem32> Uninstall-Module AzureADPreview
PS C:windowssystem32> Uninstall-Module azuread
 Module 'AzureAD' is in currently in use or you don't have the required permissions.

Step-3:

Now install the latest version of AzureADPreview. Use the below command in your Windows PowerShell or PowerShell ISE window.

PS C:windowssystem32> Install-Module AzureADPreview
The term 'Get-AzureADDirectorySettingTemplate' is not recognized as the name

Step-4:

Now the below popup will appear, click on the Yes button.

Get-AzureADDirectorySettingTemplate not recognized

Step-5:

You can see below it started installing the AzureADPreview module.

The term 'Get-AzureADDirectorySettingTemplate' is not recognized as the name

Step-6:

Once the AzureADPreview module get successfully installed, you can again run the below command Get-AzureADDirectorySettingTemplate to get the list of all settings templates. This time it will work for you with out any issue.

PS C:windowssystem32> Get-AzureADDirectorySettingTemplate
Get-AzureADDirectorySettingTemplate not recognized

You may like following Azure tutorials:

In this Azure tutorial, we discussed how to fix the error, The term ‘Get-AzureADDirectorySettingTemplate’ is not recognized as the name of a cmdlet. I hope it helped you to fix your issue.