You cannot run
Get-ADUser natively on a client machine without the Active Directory PowerShell module, which is part of RSAT. The cmdlets are compiled binaries that must exist locally to execute. However, you can effectively manage AD users by running these commands inside a remote session or by importing the necessary modules from a server where RSAT is already installed and configured.
The most common misconception is that you can simply "import" the module from a remote computer using standard parameter flags to make it work locally. This approach fails because PowerShell sessions are isolated environments. When you establish a connection to another machine, you are interacting with that machine's environment, not loading its binaries into your current local shell for independent execution. To understand why this distinction matters, consider how PowerShell handles module discovery and execution contexts.
Understanding Module Execution Contexts
PowerShell modules like
ActiveDirectory contain snap-ins and scripts that rely on specific registry keys and DLL files located in the system directory of the host machine. If you attempt to use parameters designed for remote execution, such as
-ComputerName, you are initiating a
PSSession. This action creates a new PowerShell process on the target server. Any command you type within that session runs on the remote machine, utilizing its local RSAT installation. It does not bring the
Get-ADUser function back to your local console.
This behavior is fundamental to PowerShell’s architecture. Remote management allows administrators to control servers without installing full administrative toolkits on every endpoint. For example, if you connect to a domain controller via
New-PSSession, the
Get-ADUser command queries the directory service through that remote context. Your local machine remains unaware of the AD cmdlets until the session closes or you explicitly import the module locally.
Why Import-Module -ComputerName Fails Locally
Many users search for a way to avoid installing RSAT by trying to pull the module definition from a server. The syntax
Import-Module -Name ActiveDirectory -ComputerName Server01 is invalid for the
ActiveDirectory module because this module does not support remote importation in the way some script-based modules do. Even if it did, the resulting cmdlets would only be available within the scope of that remote session.
Attempting to force this often leads to errors regarding missing dependencies or authentication failures. The correct diagnostic step is to check if the module is present on the local machine using
Get-Module -ListAvailable ActiveDirectory. If the list is empty, the module is not installed. There is no workaround that magically injects these compiled binaries into a local session without proper installation or remote session management.
Recommended Workaround: Using Invoke-Command
If you absolutely cannot install RSAT on your workstation due to policy restrictions, the standard solution is to use
Invoke-Command. This cmdlet allows you to run script blocks on a remote computer and return the results to your local console. This method respects the isolation of the local environment while leveraging the capabilities of a remote machine that has RSAT installed.
To implement this, you need access to a domain controller or a server with RSAT enabled. You can execute the following pattern to retrieve user information:
Invoke-Command -ComputerName DC01 -ScriptBlock {
Get-ADUser -Identity jdoe -Properties *
} | Format-List
This code sends the request to
DC01, executes
Get-ADUser there, and returns the formatted object to your local screen. While this works, it introduces latency and requires network connectivity to the specified server. It also limits interactive management, as you cannot pipe local objects easily into remote AD cmdlets without complex serialization.
Installing RSAT: The Proper Solution
For most IT professionals and developers, the permanent fix is to install RSAT. Microsoft provides RSAT as an optional feature in Windows 10 and Windows 11, eliminating the need for separate downloads in recent versions. This ensures that all AD cmdlets are available locally, allowing for faster execution, better error handling, and seamless integration with other local tools.
On Windows 10 version 2004 and later, or Windows 11, you can enable RSAT via Settings or PowerShell. Open PowerShell as Administrator and run:
Get-WindowsCapability -Online | Where-Object Name -like 'RSAT.ActiveDirectory*'
If the state is
NotInstalled, install it with:
Add-WindowsCapability -Online -Name 'Rsat.ActiveDirectory-DomainServices.Tools~' -Source C:\Windows\WinSxS
Once installed,
Get-ADUser becomes immediately available without any remote configuration. This approach reduces dependency on network resources and simplifies scripting workflows. If you are experiencing issues with missing properties after installation, you might want to check related troubleshooting guides. See
Get-ADUser shows much fewer info on my pc than on coworker's pc for details on property resolution issues.
Alternative: Lightweight LDAP Queries
For simple queries where you do not need the rich object model of the AD module, you can use .NET classes directly. This method requires no RSAT installation but is more verbose and less intuitive than native cmdlets. You can bind to the directory using
[System.DirectoryServices.DirectoryEntry] and perform searches using LDAP filters.
While this avoids the RSAT requirement entirely, it lacks the convenience features of PowerShell, such as automatic formatting and easy property expansion. It is generally recommended only for legacy systems or highly constrained environments where installing additional components is strictly prohibited. For managing updates or configurations on those systems, refer to
Opt in Microsoft Automatic Updates using PowerShell to ensure your baseline security posture remains strong.
Frequently Asked Questions
Can I copy the ActiveDirectory.dll file to my PC?
No, copying DLL files will not register the PowerShell provider or cmdlets correctly. The module relies on specific registry entries and manifest files that define how PowerShell loads the functionality. Manual file placement often leads to signature verification errors or missing dependencies.
Does RSAT work on Windows 11 Home?
RSAT is typically available for Windows 11 Pro, Enterprise, and Education editions. Home editions usually lack the Group Policy management features and may restrict access to certain RSAT components. Check your edition compatibility before attempting installation via Optional Features.
Why does my script fail with "command not found" even after installing RSAT?
Ensure you are restarting your PowerShell session after installation. The module path is added to the environment variable during setup, but existing sessions do not refresh automatically. Opening a new window forces PowerShell to re-evaluate the module search paths.
Is there a performance difference between local and remote AD queries?
Local queries are significantly faster as they do not incur network latency or serialization overhead. Remote sessions add round-trip time for each command execution. For bulk operations, local execution is strongly preferred to reduce total runtime.
How do I verify if RSAT is installed correctly?
Run
Get-Module -ListAvailable ActiveDirectory in an elevated PowerShell prompt. A successful installation will display the module name, version, and path. If it returns nothing, the feature is either not installed or not enabled in Windows settings.