The Active Directory (AD) module lets you manage users, computers, and other AD objects easily from PowerShell.
AD module installation in PowerShell
Start learning this pattern below
Jump into concepts and practice - no test required
Install-WindowsFeature -Name RSAT-AD-PowerShell Import-Module ActiveDirectory
Install-WindowsFeature installs the AD module on Windows Server.
Import-Module ActiveDirectory loads the module so you can use its commands.
Install-WindowsFeature -Name RSAT-AD-PowerShell Import-Module ActiveDirectory
Import-Module ActiveDirectory
Get-WindowsCapability -Name RSAT.ActiveDirectory* -Online | Add-WindowsCapability -Online
This script installs the AD module, loads it, and then lists the first 3 AD users with their names and usernames.
Install-WindowsFeature -Name RSAT-AD-PowerShell
Import-Module ActiveDirectory
Get-ADUser -Filter * -ResultSetSize 3 | Select-Object Name, SamAccountNameOn Windows 10/11, use Add-WindowsCapability instead of Install-WindowsFeature.
You need to run PowerShell as Administrator to install the module.
After installation, always import the module before using AD commands.
The AD module lets you manage Active Directory from PowerShell.
Use Install-WindowsFeature on servers or Add-WindowsCapability on Windows 10/11 to install it.
Always import the module with Import-Module ActiveDirectory before running AD commands.
Practice
Solution
Step 1: Understand the AD module functionality
The AD module provides cmdlets to manage Active Directory objects like users, groups, and computers.Step 2: Compare options with AD module purpose
Only To manage Active Directory objects and settings using PowerShell commands describes managing Active Directory with PowerShell, which matches the module's purpose.Final Answer:
To manage Active Directory objects and settings using PowerShell commands -> Option DQuick Check:
AD module = Manage Active Directory [OK]
- Confusing AD module with network monitoring tools
- Thinking it installs Windows updates
- Assuming it creates GUIs
Solution
Step 1: Identify installation command for Windows Server
On Windows Server, the correct command to install AD module is Install-WindowsFeature with the feature name RSAT-AD-PowerShell.Step 2: Review other options
Add-WindowsCapability is for Windows 10/11, Import-Module loads the module but does not install it, Enable-WindowsOptionalFeature is not the standard for AD module installation.Final Answer:
Install-WindowsFeature -Name RSAT-AD-PowerShell -> Option BQuick Check:
Windows Server install = Install-WindowsFeature [OK]
- Using Add-WindowsCapability on Windows Server
- Trying to import module before installing
- Confusing Enable-WindowsOptionalFeature with Install-WindowsFeature
Import-Module ActiveDirectory -ErrorAction SilentlyContinue; Get-Module ActiveDirectory
Solution
Step 1: Understand Import-Module with -ErrorAction SilentlyContinue
This suppresses errors if the module is missing, so no error message appears.Step 2: Check Get-Module output when module not loaded
If the module is not installed and import fails silently, Get-Module returns empty output because the module is not loaded.Final Answer:
Empty output, module not loaded -> Option AQuick Check:
Missing module + silent import = empty Get-Module output [OK]
- Expecting error message despite SilentlyContinue
- Assuming module loads automatically
- Thinking Get-Module lists all modules installed
Import-Module ActiveDirectory but get an error saying the module is not found. What is the most likely fix?Solution
Step 1: Understand error cause
Error means the Active Directory module is not installed on the system.Step 2: Identify correct installation command
Installing the module with Install-WindowsFeature RSAT-AD-PowerShell on Windows Server fixes the issue.Final Answer:
Run Install-WindowsFeature RSAT-AD-PowerShell to install the module -> Option AQuick Check:
Module not found = install it first [OK]
- Trying to import without installing
- Using Get-ADUser before module is loaded
- Assuming restart fixes missing module
Solution
Step 1: Identify correct install command for Windows 11
Windows 11 uses Add-WindowsCapability with the specific RSAT Active Directory feature name to install the module.Step 2: Import module after installation
Import-Module ActiveDirectory loads the module for immediate use after installation.Final Answer:
Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0; Import-Module ActiveDirectory -> Option CQuick Check:
Windows 11 install = Add-WindowsCapability + Import-Module [OK]
- Using Install-WindowsFeature on Windows 11
- Importing module before installing
- Using Enable-WindowsOptionalFeature incorrectly
