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

Recently, I was trying to retrieve the lists of users from my Azure Active Directory using PowerShell. I was executing the below PowerShell command.

Get-ADUser

After executing the above command, I got this error.

The complete error message was as below:

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 windows 10

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

Try the below solutions to fix your issue.

Solution-1

If you are using Windows 10 or Windows 11 or higher versions then try out this solution.

Open the PowerShell ISE and run the below PowerShell command to install the Active Directory module.

Get-WindowsCapability -Name RSAT.ActiveDirectory* -Online | Add-WindowsCapability -Online

After executing the above PowerShell command, it will start the installation like below

get-aduser powershell

Now, after the successful installation, you will get the below output

PS C:\WINDOWS\system32> Get-WindowsCapability -Name RSAT.ActiveDirectory* -Online | Add-WindowsCapability -Online


Path          : 
Online        : True
RestartNeeded : False

You can see the same output in the below screenshot.

powershell get-aduser

Now try running the Get-ADUser PowerShell command, this time you won’t get any error. If you are still facing the same issue then try out the below solution.

Solution -2

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.

  1. Click on the start menu on your machine and then search for “Windows features”
  2. Now the next step is to click on “Turn Windows features on or off”
get-aduser not recognized

3. Then you need to Expand the Remote Server Administration Tools option.

4. Now, Again Expand Role Administration Tools option

5. Then, Expand AD DS and AD LDS Tools option

6. Make sure to tick the checkbox for Active Directory Module for Windows Powershell option

7. 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 about, try out the below solution

Solution – 3

  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

powershell get-aduser not recognized

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 -4

If you are getting the error that 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, and the above solutions didn’t work for you then run the below steps to fix it:

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

import-module ActiveDirectory
get aduser is not recognized

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” or “The term ‘get-aduser’ is not recognized.” by following any of the solutions mentioned above.

The term ‘get-aduser’ is not recognized as the name of a cmdlet   (Windows 2008 server) [Solved]

If you are using Windows 2008 server and you got The term ‘get-aduser’ is not recognized as the name of a cmdlet, then below are the steps that can help you to fix the issue.

The first step is, to check if the Azure Active Directory module is present using the below PowerShell cmdlet

PS C:\WINDOWS\system32> get-module -listavailable
Powershell get aduser not recognized

Once, you will run the above command, you should able to see the Azure Active Directory module present on your machine, then run the below PowerShell cmdlet as the next step

PS C:\WINDOWS\system32> import-module activedirectory

If the Azure Active Directory module is not present and you are using the Windows 2008 server then, before running the above command, you need to install the Azure Active Directory module.

The term ‘get-aduser’ is not recognized as the name of a cmdlet   (Windows Server 2008 R2) [Solved]

if you are using Windows Server 2008 R2, then the Azure Active Directory module is by default present in your machine, you will have to install it using the below PowerShell cmdlet in the same Order.

Note: Make sure that the Active Directory Web Services (ADWS) is installed on your machine.

Import-Module ServerManager
Add-WindowsFeature RSAT-AD-PowerShell

Once, you will install the Azure Active Directory module on your machine, run the below PowerShell cmdlet.

check if the Azure Active Directory module is present using the below PowerShell cmdlet

PS C:\WINDOWS\system32> get-module -listavailable

Then run the below PowerShell cmdlet as the next step

PS C:\WINDOWS\system32> import-module activedirectory

The term ‘get-aduser’ is not recognized as the name of a cmdlet   (Windows 7) [Solved]

If you are using Windows 7 and you got The term ‘get-aduser’ is not recognized as the name of a cmdlet, then below are the steps that can help you to fix the issue.

  1. Navigate to the Control Panel and open it -> click on the Programs and Features -> Turn On/Off Windows Features
  2. Then you need to find out “Remote Server Administration Tools” and expand it.
  3. Now, Expand the “Role Administration Tools” node.
  4. Then, Expand AD DS and AD LDS Tools option.
  5. Make sure to tick the checkbox for Active Directory Module for Windows Powershell option
  6. Finally, click on the OK button to confirm the installation.

Note: One important point to note down here is, If you are using Windows 10 and you are not able to see the “Remote Server Administration Tools” option in your system then you need to install the RSAT tools for Windows 10 using the below steps.

  1. Download the Remote Server Administration Tools for Windows 10 now and install it on your machine.
  2. Once you have installed the RSAT tools, make sure to restart your machine once so that the changes will be reflected in your machine. Now you should be able to enable the Active Directory Module for Windows Powershell option using the above steps.

You may like the following Azure tutorials:

Wrapping Up

I hope this Azure tutorial, helps us to fix the below error 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

Hope, You have enjoyed this Article !!!