How to Install Active Directory Powershell Module and Import. We can use the Remote Server Administration Tools (RSAT) to manage roles and features on Windows Server hosts from our workstations. RSAT contains graphical MMC snap-ins, command-line tools, and PowerShell modules. This article will discuss installing the RSAT package on Windows 10, 11, and Windows Servers 2022, 2019, and 2022 using the Windows GUI and the PowerShell console via Feature on Demand (FoD).
Installing Remote Server Administration Tools
Before we begin, it is crucial to understand the Remote Server Administration Tools (RSAT) package. We must install the RSAT package if we use a Windows machine, workstation, or server. We use the RSAT package to manage Windows operating system machines remotely.
The PowerShell Active Directory Module is one example of a component that requires the RSAT package. We get the thrown error when we run active directory commands without RSAT, as shown in the screenshot below.
As a result, before proceeding, we must first install the prerequisites.
Installing RSAT on Windows 10
Since October 2018, the RSAT package no longer needs to be manually downloaded. The RSAT installation package is now built into the Windows 10 image and installed as a standalone feature (Features on Demand). We can now install RSAT from the Settings app in Windows 10.
Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability –Online
The command above will install all available RSAT tools inside the machine.
Installing RSAT on Windows 11
Like Windows 10, we can also install RSAT on Windows 11 through the Settings app -> Apps -> Optional Features -> click on Add an optional feature (View features) panel. Select the required RSAT packages and click Install.
We can also install RSAT in Windows 11 via PowerShell:
Add-WindowsCapability –online –Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0
Installing RSAT on Windows Server 2016, 2019, and 2022
On Windows Server, we don’t need internet access to install RSAT. Instead, we can install RSAT when the corresponding Windows Server roles or features dependencies are available. Additionally, we can install them via the Server Manager by going to Add Roles and Features -> Features -> click on Remote Server Administration Tools.
We can locate all RSAT components in two sections: the Feature Administration Tools and Role Administration Tools. Select the required options and click Next.
Install-WindowsFeature -Name "RSAT-AD-PowerShell" -IncludeAllSubFeature
Frequent RSAT Installation Issues
RSAT installations usually run smoothly with no issues, but occasional problems exist. For example, the RSAT package uses Windows Update to install and integrate RSAT into Windows. Therefore, it may need to be fixed if we temporarily disable the Windows Firewall.
If we have downloaded the RSAT package, but it does not appear or will not install correctly, enable Windows Firewall in the services window, install it, and disable it again. If that didn’t work, there might be other causes.
Frequent RSAT Installation Error Codes
The 0x800f0954 error, or missing RSAT option in the optional features, is most likely caused if we configure our machine to receive updates from a different source besides Windows Update. For example, it can be the internal Windows Server Update Services (WSUS) or Microsoft System Center Configuration Manager (SCCM) software update server.
We can use the PowerShell script below to fix the installation:
$registryWU = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" $currentWU = Get-ItemProperty -Path $registryWU -Name "UseWUServer" | select -ExpandProperty UseWUServer Set-ItemProperty -Path $registryWU -Name "UseWUServer" -Value 0 Restart-Service wuauserv Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability –Online Set-ItemProperty -Path $registryWU -Name "UseWUServer" -Value $currentWU Restart-Service wuauserv -force
Additionally, check the following list below for other frequent RSAT installation issues:
- 0x8024402c and 0x80072f8f – To download RSAT files, Windows cannot connect to the Microsoft Update service. Examine internet connectivity or install components from a local FoD image. Once checked, execute the following command.
Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.Tools~~~~0.0.1.0 -LimitAccess -Source
- 0x800f081f – make sure that the directory path with RSAT components specified as a value in the –Source parameter exists;
- 0x800f0950 – the error is similar to the above use case 0x800f0954;
- 0x80070490 – check and repair your Windows image using Deployment Image Servicing and Management (DISM) with the following command below:
DISM /Online /Cleanup-Image /RestoreHealth
Improve your Active Directory Security & Azure AD
Try us out for Free, Access to all features. – 200+ AD Report templates Available. Easily customise your own AD reports.
Import the PowerShell Active Directory Module
Connecting and Authenticating with Active Directory
Connecting to an Active Directory Domain Controller
Get-ADUser -Filter "Name -eq 'Marion'" -SearchBase "DC=IT" -Server DC01.infrasos.com
Also, by default, PowerShell will automatically find a DC to connect if we still need to supply the -Server parameter. We determine the primary DC by trying the following:
Connecting to Active Directory with Different Credentials
- Use the current credentials associated with the drive if the executed commands are from the PowerShell AD Provider.
- Utilizing the credentials of the logged-on user.
We can also specify alternate credentials using the –Credential parameter. The -Credential parameter allows us to pass in a credential object called PSCredential. For example, using an alternate credential, we can see the snippet below of the Windows AD PowerShell Get-ADUser cmdlet.
$creds = Get-Credential Get-ADUser -Filter * -Credential $creds
We also have two authentication options. As the default parameter, these types are Basic and Negotiate. Basic authentication is only possible if we encrypt our connection with SSL.
Get-Aduser -Filter * -Credential $credential -AuthType
Thank you for reading How to Install Active Directory Powershell Module and Import. We shall conclude.
How to Install Active Directory PowerShell Module and Import Conclusion
Importing the Windows PowerShell ActiveDirectory module is a straightforward and standard process. We must first install the correct RSAT version as a prerequisite. Then, using the comprehensive steps provided in this article, we should be able to install and import the ActiveDirectory module and use Active Directory commands accordingly.
Try InfraSOS for FREE
Invite your team and explore InfraSOS features for free