# Active Directory Module

## Requirements

{% hint style="info" %}
This module interacts with AD through the Active Directory Web Service that mush be running on the domain controller.&#x20;
{% endhint %}

To check if ADWS is running:

```powershell
Test-NetConnection DC1 -port 9389
```

## Installing Active Directory module

### Installing on Windows 10 and 11

```powershell
Add-WindowsCapability -online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0    
```

### Installing on Windows Servers

You can check if the module in installed with:

```powershell
Get-WindowsFeature -Name "RSAT-AD-PowerShell"
```

To install:

```powershell
Install-WindowsFeature -Name "RSAT-AD-PowerShell" –IncludeAllSubFeature
```

## Running AD Module without RSAT or admin privileges

To be able to run Active Directory module without installing RSAT you only require the DLL location in`C:\Windows\Microsoft.NET\assembly\GAC_64\Microsoft.ActiveDirectory.Management` from a computer with RSAT installed.

We are then able to grab the signed DLL and drop it on the computer we want to enumerate from and simply import the DLL as a module:

```
Import-Module .\Microsoft.ActiveDirectory.Management.dll
```

{% hint style="info" %}
If you plan on zipping the DLL to transfer over, you will need to unblock the zip file before unzipping.&#x20;

```powershell
UnBlock-File .\ADModule.zip
```

{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rfc1918.gitbook.io/offsec/active-directory/enumeration/active-directory-module.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
