How to Install and Import PowerShell Active Directory Module
The easiest way to install a PowerShell module for an active directory on a Windows system is by running this command via the PowerShell
If there is powershell AD module already installed on the VM, you can verify it by running the command
1 |
<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">Get-Module –ListAvailable </mark> |
Open the PowerShell console as an administrator and run the following command to add AD PowerShell module
1 2 |
<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">Import-Module ServerManager Add-WindowsFeature -Name "RSAT-AD-PowerShell" –IncludeAllSubFeature</mark> |
To check if the current VM already has the AD module , use the command:
1 |
<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">Get-WindowsFeature RSAT-AD-PowerShell</mark> |
1 |
AD module can be installed as via the GUI on Windows Server 2019/2016/2012 by adding a role as shown below |
Once the Ad module is installed, we can display the list of available cmdlets available on the Active Directory PowerShell module as follows:
1 |
<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">Get-Command -Module ActiveDirectory</mark> |
(Visited 84 times, 1 visits today)