> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/fr/active-directory/enumeration/active-directory-powershell-module.md).

# Module PowerShell Active Directory

### Objectif

Le module Active Directory vous permet d’utiliser des commandes comme :

{% code overflow="wrap" %}

```powershell
Get-ADDomain
Get-ADUser
Get-ADComputer
Get-ADDomainController
```

{% endcode %}

Sur un contrôleur de domaine, ce module est généralement disponible par défaut.

Sur une machine Windows 10 classique, il n’est souvent pas installé.

<figure><img src="/files/03a2c1af910101d4d1bf9f28955b58bc31e93c32" alt=""><figcaption></figcaption></figure>

### Charger les informations du domaine

Sur le contrôleur de domaine :

```bash
Get-ADDomain
```

Cette commande renvoie des informations importantes telles que :

* le nom du domaine ;
* le SID du domaine ;
* le mode fonctionnel du domaine ;
* la forêt ;
* le contrôleur de domaine principal ;
* le maître d’infrastructure ;
* les informations de configuration AD.

### Utiliser le module sur une machine sans RSAT

La DLL peut être récupérée depuis le DC :

{% code overflow="wrap" %}

```bash
C:/Windows/Microsoft.Net/assembly/GAC_64/Microsoft.ActiveDirectory.Management/v4.0_10.0.0.0__31bf3856ad364e35/Microsoft.ActiveDirectory.Management.dll
```

{% endcode %}

Nous la copions ensuite vers `WS02`, puis nous l’importons :

{% code overflow="wrap" %}

```powershell
Import-Module ./Microsoft.ActiveDirectory.Management.dll
```

{% endcode %}

Ensuite, nous pouvons tester :

{% code overflow="wrap" %}

```powershell
Get-ADDomain
```

{% endcode %}

<figure><img src="/files/f35bfe388fb29726be1c66a1369a00a4c0f66f7b" alt=""><figcaption></figcaption></figure>

### Alternative avec PowerView

Sans module Active Directory, PowerView propose des commandes équivalentes.

Obtenir les informations du domaine :

{% code overflow="wrap" %}

```powershell
Get-NetDomain
```

{% endcode %}

Obtenir la stratégie du domaine :

{% code overflow="wrap" %}

```powershell
Get-DomainPolicy
```

{% endcode %}

Afficher la `SystemAccess` section :

{% code overflow="wrap" %}

```powershell
(Get-DomainPolicy)."SystemAccess"
```

{% endcode %}

Cela vous permet d’obtenir des informations telles que :

* politique de mot de passe ;
* verrouillage de compte ;
* l’âge maximal du mot de passe ;
* les paramètres de sécurité du domaine.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/fr/active-directory/enumeration/active-directory-powershell-module.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
