---
title: "Import PowerShell Active Directory Module: Step-by-Step Guide"
description: "Install and import the PowerShell Active Directory module on all Windows versions with ease."
canonical: "https://adamtheautomator.com/powershell-import-active-directory/"
---

# Import PowerShell Active Directory Module: Step-by-Step Guide

> Install and import the PowerShell Active Directory module on all Windows versions with ease.

Source: https://adamtheautomator.com/powershell-import-active-directory/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Import PowerShell Active Directory Module: Step-by-Step Guide](https://adamtheautomator.com/wp-content/uploads/2019/08/active-directory-module.png)

# Import PowerShell Active Directory Module: Step-by-Step Guide

[![](https://secure.gravatar.com/avatar/995fcc2faf7fc9d3f15061d8e6c5b84f4b751d96502ef7afb4f9f648a58b36a4?s=192&d=mm&r=g)Stuart Squibb](https://adamtheautomator.com/author/stuart/)20 August 20193 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[Active Directory](/tag/active-directory/)[PowerShell](/tag/powershell/)

Table of Contents

*   [Install RSAT (Remote Server Administration Tools)](#install-rsat-remote-server-administration-tools-)
*   [RSAT for Pre 1809 Windows 10](#rsat-for-pre-1809-windows-10)
*   [RSAT for post-1809 Windows 10](#rsat-for-post-1809-windows-10)
*   [RSAT for Windows Server 2008R2 and Later](#rsat-for-windows-server-2008r2-and-later)
*   [Import the PowerShell Active Directory Module](#how-to-powershell-load-the-ad-module)
*   [Connecting and Authenticating](#connecting-and-authenticating)
*   [Connecting to a Specific Active Directory Domain Controller](#connecting-to-a-specific-active-directory-domain-controller)
*   [Connecting to Active Directory with Alternate Credentials](#connecting-to-active-directory-with-alternate-credentials)
*   [Summary](#summary)
*   [Further Reading](#further-reading)

A prerequisite for every PowerShell Active Directory (AD) task is to import the PowerShell Active Directory module. This popular module allows administrators to query and make changes to Active Directory with PowerShell.

> _Scan Your AD for 930+ Million Compromised Passwords. [Download Specops Password Auditor](https://specopssoft.com/contact-us/?utm_source=ata&utm_medium=referral&utm_campaign=na_ata&utm_content=mention), a FREE read only tool that identifies password-related vulnerabilities._

In this blog post, we’re going to dive into how to install the PowerShell Active Directory module on Windows 10. We’ll then cover how to connect to AD with PowerShell and go into the various ways you can authenticate to AD.

## Install RSAT (Remote Server Administration Tools)

Before we begin, you should first be aware of the RSAT package. If you are using a workstation variant of Windows then you will need to install the _Remote Server Administration Tools_ (RSAT) package. When using a Server variant of Windows, RSAT is available already.

Without RSAT you’ll get the annoying _‘the term Get-AD\* is not recognized as the name of a cmdlet, function, script file, or operable program’_ type messages when you attempt to run the commands we’ll be covering.

### RSAT for Pre 1809 Windows 10

[Download an RSAT package](https://docs.microsoft.com/en-US/troubleshoot/windows-server/system-management-components/remote-server-administration-tools) if you’re on Windows 10 pre-build 1809 from Microsoft. The install is simple and straightforward.

> _Learn how to [find your Windows 10 build version here](https://support.techsmith.com/hc/en-us/articles/115001763452-How-to-Check-Windows-10-Build) if you don’t know how._

Once you have installed RSAT, ensure the _Active Directory Module for Windows PowerShell_ is enabled in _Windows Features_. By default, it should be already.

![Enabling a feature to import the PowerShell Active Directory module](/wp-content/uploads/2019/08/Win7RSATADModule.png)

Enabling the Active Directory Module for Windows PowerShell

### RSAT for post-1809 Windows 10

In versions of Windows from 1809 onwards the RSAT capabilities are available as optional features. There’s no need to download an external package.

To import the PowerShell Active Directory module, you must first install it. On Windows 10 post-1809, use the `Add-WindowsCapability` cmdlet. This enables the _Rsat.ActiveDirectory.DS-LDS.Tools_ optional feature as shown below.

```powershell
PS51> Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0
```

> _The above syntax was tested on Windows 10 Build 1903 and on Windows 7._

### RSAT for Windows Server 2008R2 and Later

On Windows Server, use the PowerShell _ServerManager_ module to enable the _RSAT-AD-PowerShell_ feature in PowerShell.

```powershell
PS51> Import-Module ServerManager
PS51> Install-WindowsFeature -Name RSAT-AD-PowerShell
```

## Import the PowerShell Active Directory Module

It’s likely PowerShell will auto-import the module when installed. But if you’d like to ensure it loads properly, you can also use the `Import-Module` command.

Related:[Understanding and Building PowerShell Modules](https://adamtheautomator.com/powershell-modules/)

To import the PowerShell Active Directory module, run `Import-Module ActiveDirectory`. If the module is installed in the right place, you will receive no errors.

## Connecting and Authenticating

Once the ActiveDirectory module is set up, you can then use the Active Directory PowerShell cmdlets.

Although the cmdlets interact with different parts of AD, nearly all of them have common parameters. Two of those parameters are `Server` and `Credential`.

### Connecting to a Specific Active Directory Domain Controller

By default, the AD cmdlets will find a domain controller for you. However, if you need to connect to a different domain controller, you can use the `Server` parameter.

The `Server` parameter isn’t mandatory. PowerShell will attempt to find a domain controller to connect to by default. The domain controller is determined by trying the following in the listed order:

1.  Use the `Server` property of objects passed in on the pipeline.
2.  Use the server associated with the AD PowerShell provider drive, if in use.
3.  Use the domain of the client computer.

You can connect to a specific domain controller by providing a value for the `Server` parameter. You can specify several different ADDS objects in different formats such as:

*   FQDN or NETBIOS name such as _domain.local_ or _DOMAIN_ which will be the domain name specified
*   FQDN or NETBIOS name such as _server.domain.local_ or SERVER that will be the domain controller.
*   A fully-qualified domain controller and port such as _server.domain.local:3268_

### Connecting to Active Directory with Alternate Credentials

By default, the Active Directory PowerShell cmdlets will use a two-step process for determining the user account to connect to AD.

1.  Use the credentials associated with the PowerShell [AD provider drive](https://devblogs.microsoft.com/scripting/playing-with-the-ad-drive-for-fun-and-profit/), if the command is run from there.
2.  Utilizing the credentials of the logged-on user.

You can also specify alternate credentials using the `Credential` parameter.

The `Credential` parameter allows you to pass in a [_PSCredential_ object](https://adamtheautomator.com/powershell-get-credential/). If you provide a username, you will be prompted for a password and these credentials will be used.

You can see an example below of using the [`Get-AdUser`](https://adamtheautomator.com/get-aduser/ "Get-AdUser") cmdlet using an alternate credential.

Related: [Get-AdUser: Finding Active Directory users with PowerShell](https://adamtheautomator.com/get-aduser/)

```powershell
PS51> $credential = Get-Credential
PS51> Get-Aduser -Filter * -Credential $credential
```

> _Are there compromised passwords in your Active Directory? [Download Specops Password Auditor](https://specopssoft.com/contact-us/?utm_source=ata&utm_medium=referral&utm_campaign=na_ata&utm_content=mention) and scan for free._

You also have two possible authentication types available, controlled by the `AuthType` parameter. These types are _Negotiate_ (the default) and _Basic_. Basic authentication is only possible over an SSL connection.

```powershell
PS51> Get-Aduser -Filter * -Credential $credential -AuthType Negotiate|Basic
```

## Summary

To import the PowerShell Active Directory module is a straightforward and common process. Using the instructions provided in this article, you should be well on your way to automating all the Active Directory things!

## Further Reading

*   **_[32 Active Directory Scripts to Automate Anything](https://adamtheautomator.com/active-directory-scripts/)_**

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-import-active-directory%2F&text=Import%20PowerShell%20Active%20Directory%20Module%3A%20Step-by-Step%20Guide)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-import-active-directory%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-import-active-directory%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2024/11/image-23.png)

### [Managing Active Directory Groups with PowerShell: The Ultimate Guide](/powershell-ad-groups-guide/)

Learn how to manage Active Directory groups with PowerShell! This hands-on guide shows you how to query, create and modify AD groups using practical real-world

![](https://adamtheautomator.com/wp-content/uploads/2019/08/database-152091_1280.png)

### [Active Directory Database: PowerShell Monitoring Made Easy](/active-directory-database/)

Find the ntds.dit location and monitor your Active Directory database using PowerShell.

![](https://adamtheautomator.com/wp-content/uploads/2019/07/panic-1393619_1280.png)

### [How to Find Locked Out Users in Active Directory with PowerShell](/find-locked-out-users-in-active-directory-powershell/)

See what we can do to find locked out users in Active Directory with PowerShell!

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
