Bird
Raised Fist0
PowerShellscripting~20 mins

AD module installation in PowerShell - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
AD Module Installation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
What is the output of importing the Active Directory module?
You run the command Import-Module ActiveDirectory in PowerShell on a Windows Server with the AD module installed. What is the expected output?
PowerShell
Import-Module ActiveDirectory
ANo output and no error
BWarning: Module is deprecated
CList of all AD cmdlets displayed
DError: Module 'ActiveDirectory' not found
Attempts:
2 left
💡 Hint
Importing a module usually does not show output unless there is an error.
💻 Command Output
intermediate
1:30remaining
What happens if you try to install the AD module on Windows 10 using PowerShell?
You run Install-WindowsFeature RSAT-AD-PowerShell on Windows 10. What is the expected result?
PowerShell
Install-WindowsFeature RSAT-AD-PowerShell
AWarning: Feature already installed
BAD module installs successfully
CError: Install-WindowsFeature is not recognized
DPrompt to restart computer
Attempts:
2 left
💡 Hint
Install-WindowsFeature is a Server-specific cmdlet.
📝 Syntax
advanced
2:00remaining
Which command correctly installs the AD module on Windows Server 2022?
Select the correct PowerShell command to install the Active Directory module on Windows Server 2022.
AEnable-WindowsOptionalFeature -Online -FeatureName RSAT-AD-PowerShell
BInstall-WindowsFeature -Name RSAT-AD-PowerShell
CAdd-WindowsCapability -Online -Name RSAT-AD-PowerShell
DInstall-Module -Name ActiveDirectory
Attempts:
2 left
💡 Hint
On Windows Server, the cmdlet to install roles and features is Install-WindowsFeature.
🔧 Debug
advanced
2:00remaining
Why does this command fail to import the AD module?
You run Import-Module ActiveDirectory but get the error: ModuleNotFoundException: Module 'ActiveDirectory' not found. What is the most likely cause?
PowerShell
Import-Module ActiveDirectory
AYou need to run PowerShell as administrator
BThe PowerShell version is too new and incompatible
CThe module name is case sensitive and should be 'activedirectory'
DThe Active Directory module is not installed on this machine
Attempts:
2 left
💡 Hint
Check if the module is installed before importing.
🚀 Application
expert
2:30remaining
How to verify if the AD module is installed and available in PowerShell?
You want to check if the Active Directory module is installed and ready to use in your PowerShell session. Which command will give you a list of available modules including AD?
AGet-Module -ListAvailable | Where-Object { $_.Name -eq 'ActiveDirectory' }
BGet-InstalledModule -Name ActiveDirectory
CFind-Module -Name ActiveDirectory
DGet-Command -Module ActiveDirectory
Attempts:
2 left
💡 Hint
You want to see modules installed on your system, not just imported.

Practice

(1/5)
1. What is the main purpose of the Active Directory (AD) module in PowerShell?
easy
A. To install Windows updates automatically
B. To create graphical user interfaces for Windows applications
C. To monitor network traffic in real-time
D. To manage Active Directory objects and settings using PowerShell commands

Solution

  1. Step 1: Understand the AD module functionality

    The AD module provides cmdlets to manage Active Directory objects like users, groups, and computers.
  2. 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.
  3. Final Answer:

    To manage Active Directory objects and settings using PowerShell commands -> Option D
  4. Quick Check:

    AD module = Manage Active Directory [OK]
Hint: AD module is for Active Directory management in PowerShell [OK]
Common Mistakes:
  • Confusing AD module with network monitoring tools
  • Thinking it installs Windows updates
  • Assuming it creates GUIs
2. Which PowerShell command correctly installs the Active Directory module on a Windows Server?
easy
A. Add-WindowsCapability -Name RSAT-AD-PowerShell
B. Install-WindowsFeature -Name RSAT-AD-PowerShell
C. Import-Module ActiveDirectory
D. Enable-WindowsOptionalFeature -FeatureName RSAT-AD-PowerShell

Solution

  1. 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.
  2. 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.
  3. Final Answer:

    Install-WindowsFeature -Name RSAT-AD-PowerShell -> Option B
  4. Quick Check:

    Windows Server install = Install-WindowsFeature [OK]
Hint: Use Install-WindowsFeature on servers, not Add-WindowsCapability [OK]
Common Mistakes:
  • Using Add-WindowsCapability on Windows Server
  • Trying to import module before installing
  • Confusing Enable-WindowsOptionalFeature with Install-WindowsFeature
3. What will be the output of this PowerShell command sequence on Windows 10 if the AD module is not installed?
Import-Module ActiveDirectory -ErrorAction SilentlyContinue; Get-Module ActiveDirectory
medium
A. Empty output, module not loaded
B. No output, module is imported silently
C. An error message about missing module
D. List of all installed modules including ActiveDirectory

Solution

  1. Step 1: Understand Import-Module with -ErrorAction SilentlyContinue

    This suppresses errors if the module is missing, so no error message appears.
  2. 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.
  3. Final Answer:

    Empty output, module not loaded -> Option A
  4. Quick Check:

    Missing module + silent import = empty Get-Module output [OK]
Hint: Silent import hides errors; check Get-Module for loaded modules [OK]
Common Mistakes:
  • Expecting error message despite SilentlyContinue
  • Assuming module loads automatically
  • Thinking Get-Module lists all modules installed
4. You run Import-Module ActiveDirectory but get an error saying the module is not found. What is the most likely fix?
medium
A. Run Install-WindowsFeature RSAT-AD-PowerShell to install the module
B. Restart PowerShell and try again
C. Run Get-ADUser before importing the module
D. Use Import-Module ActiveDirectory -Force to force import

Solution

  1. Step 1: Understand error cause

    Error means the Active Directory module is not installed on the system.
  2. Step 2: Identify correct installation command

    Installing the module with Install-WindowsFeature RSAT-AD-PowerShell on Windows Server fixes the issue.
  3. Final Answer:

    Run Install-WindowsFeature RSAT-AD-PowerShell to install the module -> Option A
  4. Quick Check:

    Module not found = install it first [OK]
Hint: Install module before importing to avoid 'not found' error [OK]
Common Mistakes:
  • Trying to import without installing
  • Using Get-ADUser before module is loaded
  • Assuming restart fixes missing module
5. On a Windows 11 machine, which command sequence correctly installs and imports the Active Directory module for immediate use?
hard
A. Import-Module ActiveDirectory; Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0
B. Install-WindowsFeature RSAT-AD-PowerShell; Import-Module ActiveDirectory
C. Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0; Import-Module ActiveDirectory
D. Enable-WindowsOptionalFeature -Online -FeatureName RSAT-AD-PowerShell; Import-Module ActiveDirectory

Solution

  1. 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.
  2. Step 2: Import module after installation

    Import-Module ActiveDirectory loads the module for immediate use after installation.
  3. Final Answer:

    Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0; Import-Module ActiveDirectory -> Option C
  4. Quick Check:

    Windows 11 install = Add-WindowsCapability + Import-Module [OK]
Hint: Use Add-WindowsCapability on Windows 10/11, then import module [OK]
Common Mistakes:
  • Using Install-WindowsFeature on Windows 11
  • Importing module before installing
  • Using Enable-WindowsOptionalFeature incorrectly