Subversion Repositories rld.openvpn

Rev

Blame | Last modification | View Log | Download

# “Get ADUser Not Recognized” Error in PowerShell

<img width="70" height="70" src="../_resources/1689349198-bpfull_7cc1c10d3c4844639df39d7c9c2afc44.jpg"/>

[Jonathan Blackwell](https://blog.netwrix.com/author/jonathan-blackwell/)

Published: May 8, 2023

Updated: July 17, 2023

The Get-ADUser PowerShell cmdlet is very helpful for [Active Directory](https://www.netwrix.com/what_is_active_directory_e-book.html?cID=70170000000kgEZ "https://www.netwrix.com/what_is_active_directory_e-book.html") user management. But what if you try to use Get-ADUser and get the error below?

**The term ‘Get-ADUser’ is not recognized as the name of a cmdlet, function, script file or operable program.**

<img width="730" height="157" src="../_resources/01_a8eb107ff3d2410e9481bcb4b921f559.webp"/>

This error simply means that the Active Directory module for PowerShell is not available on your machine. This module is installed by default on domain controllers, if you want to use PowerShell remotely, you need to install the module on your machine.

Read on to learn how to install the Active Directory module on Windows 10 or Windows Server and then import it to your current session so you can run Get-ADUser without getting an error message.

Handpicked related content:

- [\[Free Ebook\] Windows PowerShell Scripting Tutorial for Beginners](https://www.netwrix.com/powershell_tutorial_pdf.html?cID=70170000000kgEZ)
    

## <a id="Step_1_Install_the_PowerShell_Active_Directory_Module"></a>Step 1: Install the PowerShell Active Directory Module

### <a id="Installing_PowerShell_on_Windows_10"></a>Installing PowerShell on Windows 10

The Windows PowerShell cmdlets are included in the Windows Remote Server Administration Tools (RSAT). To install RSAT on Windows 10 version 1809 or later, use the following command:

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

If you are running an earlier version of Windows, you will need to download and install RSAT manually.

### <a id="Installing_PowerShell_on_Windows_Server"></a>Installing PowerShell on Windows Server

The procedures for installing PowerShell on Windows Server are the same across all the following versions:

- Windows Server 2019
- Windows Server 2008 and 2008 R2
- Windows Server 2012 and 2012 R2
- Windows Server 2016

You can use either of the following two methods.

#### Method 1: Install using the Wizard

1.  In the **Start** menu, Navigate to **Start?**and then?**Server Manager**.
2.  Click **Manage** in the upper right corner and then choose **Add Roles & Features**.
3.  If the wizard displays a **Before you Begin**?dialog, click **Next.**
4.  Select **Role-based or Feature-based Installation** and click **Next**.
5.  Click the **Select a Server from the Server pool**?option and choose your server. Click **Next**.
6.  On the?**Server Roles**?page, no changes are required, so simply click **Next**.
7.  On the **Features**?page, expand?**Remote Server Administration Tools** **? Role Administration Tools** **? AD DS and AD LDS Tools**, andclick **Active Directory Module for Windows PowerShell**. Then click **Next**.
8.  On the **Confirmation?**page, click **Install**. When the installation is complete, click **Close**.

#### Method 2: Install using PowerShell

1.  Click **Start** and search for **“PowerShell”**. Choose **“Windows PowerShell”**?from the search results.
2.  Install the PowerShell AD module by running the **Install-WindowsFeature** cmdlet. To add child features, be sure to include the parameters shown here:

```
Install-WindowsFeature -Name “RSAT-AD-PowerShell” -IncludeAllSubFeature
```

<img width="730" height="184" src="../_resources/02_e341ad45b69b48599b602b9940e6b08a.webp"/>

## <a id="Step_2_Import_the_Active_Directory_PowerShell_Module"></a>Step 2: Import the Active Directory PowerShell Module

Once the module is installed, you need to add it to your current session. The following steps are valid for both Windows 10 and all Windows Server versions:

1.  Click **Start** and search for **“PowerShell”.** Choose?**WindowsPowerShell?**from the search results.
2.  Run the following command to verify that the module is available on your system:

```
Get-Module -Name ActiveDirectory -ListAvailable
```

<img width="730" height="189" src="../_resources/03_2c9fd831dd7a461f9b4ad5b879556fb2.webp"/>

3.  Import the module using the?Import-Module?cmdlet as follows:

```
Import-Module -Name ActiveDirectory
```

## <a id="Next_Steps"></a>Next Steps

Now that you have installed and imported the Active Directory PowerShell module, you can avoid the dreaded “Get-ADUser Not Recognized” error.

<img width="90" height="90" src="../_resources/1689349198-bpfull_7cc1c10d3c4844639df39d7c9c2afc44.jpg"/>

[Jonathan Blackwell](https://blog.netwrix.com/author/jonathan-blackwell/)

Since 2012, Jonathan Blackwell, an engineer and innovator, has provided engineering leadership that has put Netwrix GroupID at the forefront of group and user management for Active Directory and Azure AD environments. His experience in development, marketing, and sales allows Jonathan to fully understand the Identity market and how buyers think.