The term ‘get-aduser’ is not recognized as the name of a cmdlet in Windows 10 PowerShell

In this Azure AD tutorial, we will discuss how to fix an error the term ‘get-aduser’ is not recognized as the name of a cmdlet in Windows 10 PowerShell that comes while trying to retrieve users from Azure active directory.

The term ‘get-aduser’ is not recognized as the name of a cmdlet in Windows 10 PowerShell

The error comes as the term ‘get-aduser’ is not recognized as the name of a cmdlet in Windows 10 PowerShell.

The full error was coming as:

get-aduser : The term ‘get-aduser’ 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-aduser
  • ~~
    • CategoryInfo : ObjectNotFound: (get-aduser:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException
the term get-aduser is not recognized as the name of a cmdlet windows 10
get aduser not recognized

get-aduser is not recognized as the name of a cmdlet powershell [Solved]

Solution -1

If you are getting the error “The term ‘Get-ADUser’ is not recognized as the name of a cmdlet, function, script file, or operable program” or “get aduser not recognized”. Then you can try out the below solutions.

The first step you need to try out is, You need to enable the Active Directory Module for Windows Powershell feature in your machine. Follow the below steps to enable the Active Directory Module for Windows Powershell option.

  • Click on the start menu in your machine and then search for “windows features”
  • Now the next step is to click on “Turn Windows features on or off”
  • Then you need to Expand the Remote Server Administration Tools option
  • Now, Again Expand Role Administration Tools option
  • Then, Expand AD DS and AD LDS Tools option
  • Make sure to tick the checkbox for Active Directory Module for Windows Powershell option
  • Now, You need to Confirm that it’s okay to install the feature

If the above solution didn’t work for you, then nothing to worry, try out the below solution

get aduser not recognized [Solved]

Solution – 2

  1. Open the Window PowerShell or PowerShell ISE with Run as Administrator mode
get aduser not recognized

2. Run the below PowerShell command to find out the path for your PowerShell Profile where it is located.

PS C:\WINDOWS\system32> $profile

You can able to see, it returned me with the below path

C:\Users\Bijay\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1

get aduser not recognized error

3. The next step is, Navigate to C:\Users\Bijay\Documents\, You will not find a folder with the name WindowsPowerShell.

Since the folder is not present, create a folder with the name WindowsPowerShell, then you can use the text editor to create a file called Microsoft.PowerShell_profile.ps1 and add the below line

import-module activedirectory

Now make sure to save the file and then close all your Open PowerShell Sessions. Now This solution should work for you. You can run the script now, it should not give any error this time.

Solution – 3

If you are getting the error the term ‘get-aduser’ is not recognized as the name of a cmdlet while working in PowerShell in Windows 10, Windows Server 2016 or Windows Server 2012/2012 R2, then run the below steps to fix it:

Open Windows command prompt as an administrator and run the below command.

import-module ActiveDirectory

Once you installed it, you can verify by running the below command:

get-module -listavailable

Now you will not get the error if you will try to execute the Active Directory command get-aduser.

The term ‘get-aduser’ is not recognized as the name of a cmdlet windows 10 PowerShell [Solved]

Now, let me tell you the mistake I was doing.

A very silly mistake.

I was trying to get users from Azure Active Directory using PowerShell in Windows 10.

And my case I was using the Active Directory command (get-aduser) rather than the Azure Active Directory command (Get-AzADUser) to retrieve the users from Azure AD.

When I run the below command:

Get-AzADUser

Note: We will not have AD configured in the local windows 10 system.

So this is How you can able to fix the error “get aduser not recognized” by following any of the solutions mentioned above.

You may like following Azure tutorials:

Wrapping Up

I hope this Azure tutorial, helps us to fix the below errors on windows 7, Windows 10, Windows Server 2016, or Windows Server 2012/2012 R2, etc

  • The term ‘get-aduser’ is not recognized as the name of a cmdlet windows 10.
  • get-aduser is not recognized as the name of a cmdlet PowerShell.
  • The term ‘get-aduser’ is not recognized as the name of a cmdlet, function, script file, or operable program.
  • get aduser not recognized
  • get aduser is not recognized

Hope, You have enjoyed this Article !!!

Leave a Comment