Error: Get-ADUser Not Recognized
Before you start to use Get-ADUser for Active Directory User Management, you need to first verify that you have all the pre-requisites installed otherwise you will get the below error:
“The Terms ‘Get-ADUser’ is not recognized as the name of a cmdlet, function, script file or operable program”.
This error message means that the Active Directory module for PowerShell is not loaded, and therefore, the term “Get-ADUser” is not recognized.
The Active Directory PowerShell module unites a gathering of cmdlets used to manage on-premises Active Directory. You utilize these command-lets for:
- Domain Management
- Users Management
- Groups Management
- Objects Management
The Active Directory PowerShell module is by default installed on domain controllers. However, if you want to use PowerShell remotely for Active Directory, you need to install the module on your operating system.
The following sections address multiple ways to install the Active Directory module based on your operating system so as to avoid Get-ADUser is Not Recognized error.
Installing PowerShell on Windows 10
To install the AD DS Tools on Windows 10 version 1809 or later, use the following command:
Get-WindowsCapability -Name RSAT.ActiveDirectory* -Online | Add-WindowsCapability -Online
However, it is important to remember, that RSAT must be manually downloaded, in case you are running a previous version of Windows Client.
Installing PowerShell on Windows Server
While Windows 10 has different installation procedures based on version, Windows Server has maintained the same installation method across multiple versions.
While following instruction specifically pertains to Windows Server 2019, they are also applicable for other versions such as:
- Windows Server 2008 and 2008 R2
- Windows Server 2012 and 2012 R2
- Windows Server 2016
Method 1: Install via Add Roles and Features
- In the “Start Menu”, Navigate to “Start” and then “Server Manager”.
- Within “Server Manager”, Navigate to “Manage” (upper right corner) and click, then proceed with “Adding Roles & Features”.
- Within “Add Roles & Features Wizard”, proceed to the “Next” option if the “Before you Begin” dialog is displayed. If not, proceed to the next step.
- Proceed with selecting the “Role-based or Feature-based Installation”, then navigate to “Next”.
- Click on the “Select a Server from the Server pool” option, then choose the Server Name. Navigate to the “Next” option.
- Simply Click the “Next” option on the “Server Roles”, page since no changes are required.
- After navigating to the “Features” page, expand “Remote Server Administration Tools ⇨ Role Administration Tools ⇨ AD DS and AD LDS Tools”, then click on “Active Directory Module for Windows Powershell”. Then select the “Next” option.
- Once on the “Confirmation page”, Select “Install” and Wait for Installation. Then Select “Close”.
Method 2: Install via PowerShell to Run Get-AdUser
- Select “Start” & Search “Powershell”. Choose “Windows PowerShell” from the search results.
- Utilize the Install-WindowsFeature command-lets to install the AD Powershell console. Then proceed by specifying the feature -Name (RSAT-AD-PowerShell followed by adding the -IncludeAllSubFeature parameter to add any child features.
- Install-WindowsFeature -Name “RSAT-AD-PowerShell” -IncludeAllSubFeature
Importing Active Directory PowerShell Module
One of the preferred ways to import the module is as follows:
The following steps are valid for both Windows 10 and all server versions. To import the Active Directory PowerShell module:
- Select “Start” option and search for “PowerShell”. Choose “WindowsPowerShell” from within search results.
- Run Get-Module command to specify the name (ActiveDirectory) and –ListAvailable parameters to search modules, This will verify that module is available on the system.
- Get-Module -Name ActiveDirectory -ListAvailable
- Import the module using the Import-Module cmdlet, again specifying the module’s name (ActiveDirectory) using the -Name parameter.
- Import-Module -Name ActiveDirectory
You have installed and imported the Active Directory PowerShell module/ This would enable you to prevent Get-ADUser Not Recognized Error. Let’s start working with command-let and its some common parameters to fetch a different set of users.
Jonathan BlackwellView Profile
Since 2012, Jonathan Blackwell, an engineer and innovator, has provided engineering leadership that has put 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.