How To Install And Import PowerShell Active Directory Module?

A common misconception, especially with new Windows system administrators, is they should log in to the domain controller server to manage the Active Directory. I’ve seen organizations where even the frontline service desk is allowed to log in to the domain controller servers just to provision new user accounts or create groups.

Microsoft has introduced the Remote Server Administration Tools (RSAT), allowing other computers (server or workstation) to remotely manage the Active Directory and other services running on Windows Server 2008 R2 and above. Part of the RSAT is the Active Directory PowerShell module, which administrators can use to manage the Active Directory using PowerShell cmdlets.

Stick around, and we’ll show different ways to have the Active Directory module on Windows Server and client computers.

Note. Any installation method involving the DISM module or DISM.exe installs all RSAT tools, not just the ActiveDirectory PowerShell module.

Contents

Toggle
  • Install PowerShell Active Directory Module on Windows Server
    • Using the Add Roles and Features Wizard (Server Manager Console)
    • Using Install-WindowsFeature Cmdlet (ServerManager Module)
  • Install PowerShell Active Directory Module on Windows 10 or 11
    • Using the Optional Features in Windows Settings
    • Using the Add-WindowsCapability Cmdlet (DISM Module)
    • Using DISM.exe
  • Import PowerShell Active Directory Module after Installing
  • Import PowerShell Active Directory Module without Installing

Install PowerShell Active Directory Module on Windows Server

While the Active Directory Module is automatically installed on servers with the Active Directory Domain Services (AD DS) role, it has to be installed on other servers that don’t hold the same role.

There are a few ways to install the Active Directory Module on Windows Servers, and we’ll tackle them next.

Using the Add Roles and Features Wizard (Server Manager Console)

The Server Manager console is a graphical user interface to manage the local and remote servers. It also allows administrators to install roles and features, including the Active Directory Module.

On your server, open the Server Manager.

import-module activedirectory

On the Dashboard, click “Add roles and features.”

import module active directory

When the “Add Roles and Features Wizard” window shows up, click Next until you reach the “Features” page.

Expand “Remote Server Administration Tools” → “AD DS and AD LDS Tools” and check the “Active Directory module for Windows PowerShell” box, then click Next.

powershell active directory module windows

On the Confirmation page, review the selection and click Install.

install-module activedirectory

Wait for the installation to finish and click Close.

install active directory powershell module

Using Install-WindowsFeature Cmdlet (ServerManager Module)

Installing features in the Server Manager console has a cmdlet counterpart in PowerShell called Install-WindowsFeature. This cmdlet also has an alias called Add-WindowsFeature. These cmdlets are part of the ServerManager module that’s built-in to Windows servers.

install ad module powershell

But first, let’s find out the Active Directory Module for Windows PowerShell feature status. Open Windows PowerShell as admin and run this command.

Get-WindowsFeature -Name RSAT*

As you can see below, the RSAT-AD-PowerShell feature install state is available. This status means we can install it.

import ad module powershell

Run this command to install the RSAT-AD-PowerShell feature.

Install-WindowsFeature -Name RSAT-AD-PowerShell

The screenshot below shows the result of a successful installation.

powershell active directory module

Install PowerShell Active Directory Module on Windows 10 or 11

On modern Windows 10 builds (1809 and newer), the RSAT became a part of Features on Demand (FoD). You can install RSAT directly via the Optional Features in Windows Settings, DISM.exe, and Add-WindowsCapability.

Using the Optional Features in Windows Settings

On your Windows computer, press WIN+R and run this command to open the Optional Features settings.

ms-settings:optionalfeatures

powershell install ad module

Click the “View features” button.

install module active directory

In the “Add an optional feature” window, search RSAT, check the “RSAT: Active Directory Domain Services Tools” box, and click Next.

install active directory module powershell

Click Install on the next page.

powershell import ad module

Wait for the feature to finish installing.

import active directory module

Using the Add-WindowsCapability Cmdlet (DISM Module)

Another method to install RSAT via Feature on Demand is the Add-WindowsCapability cmdlet. This cmdlet is part of the DISM module in Windows PowerShell.

Open Windows PowerShell as admin and run this command to find the RSAT feature to install.

Get-WindowsCapability -Online -Name RSAT* | Format-Table

As you can see, multiple features match. But in this instance, what we want is the Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0. Notice that the State is NotPresent, which means it is not yet installed.

active directory powershell module

To install, run this command:

Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0

powershell import active directory module

Wait for the installation to finish.

import active directory module powershell

Using DISM.exe

You can also install RSAT using the DISM.exe tool. To do so, open an elevated CMD or PowerShell and run this command.

DISM.exe /Online /Add-Capability /CapabilityName:Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0

active directory module for windows powershell

Import PowerShell Active Directory Module after Installing

Now that you’ve installed the PowerShell Active Directory Module, you can import it into Windows PowerShell using this command.

Import-Module ActiveDirectory

powershell install active directory module windows 11

If you’re using PowerShell 7+, use the Windows PowerShell compatibility switch (-UseWindowsPowerShell).

powershell import module active directory

Import PowerShell Active Directory Module without Installing

You can also import the PowerShell Active Directory Module from a remote computer that has it. This way, you do not have to install it first.

First, create a session object to the remote command by running this command on your local PowerShell window. This method uses PowerShell remoting via WinRM.

$session = New-PSSession -ComputerName DC1

Next, export the ActiveDirectory module from the remote computer to the local computer. The module is saved to $env:HOMEPATH\ Documents\ WindowsPowerShell\ Modules\ <MODULE NAME> folder.

Export-PSsession -Session $session -Module ActiveDirectory -OutputModule RemoteADModule

Now that the ActiveDirectory module is exported as RemoteADModule to your local machine, you can import it like so:

Import-Module RemoteADModule

powershell ad module

Tag » Active Directory Web Services Download