> 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/es/active-directory/enumeration/active-directory-powershell-module.md).

# Módulo de PowerShell de Active Directory

### Objetivo

El módulo de Active Directory te permite usar comandos como:

{% code overflow="wrap" %}

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

{% endcode %}

En un controlador de dominio, este módulo suele estar disponible de forma predeterminada.

En una máquina clásica con Windows 10, a menudo no está instalado.

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

### Cargar información del dominio

En el controlador de dominio:

```bash
Get-ADDomain
```

Este comando devuelve información importante como:

* el nombre del dominio;
* el SID del dominio;
* el modo funcional del dominio;
* el bosque;
* el controlador de dominio principal;
* el maestro de infraestructura;
* información de configuración de AD.

### Usar el módulo en una máquina sin RSAT

La DLL puede recuperarse desde el 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 %}

Luego lo copiamos a `WS02`, luego lo importamos:

{% code overflow="wrap" %}

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

{% endcode %}

Luego podemos probar:

{% code overflow="wrap" %}

```powershell
Get-ADDomain
```

{% endcode %}

<figure><img src="/files/0938fff95168e659010ad8f74fd1d6facd0ccb7c" alt=""><figcaption></figcaption></figure>

### Alternativa con PowerView

Sin un módulo de Active Directory, PowerView ofrece comandos equivalentes.

Obtener información del dominio:

{% code overflow="wrap" %}

```powershell
Get-NetDomain
```

{% endcode %}

Obtener la directiva del dominio:

{% code overflow="wrap" %}

```powershell
Get-DomainPolicy
```

{% endcode %}

Mostrar la `SystemAccess` sección:

{% code overflow="wrap" %}

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

{% endcode %}

Esto te permite obtener información como:

* política de contraseñas;
* bloqueo de cuenta;
* la edad máxima de la contraseña;
* configuración de seguridad del dominio.


---

# 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/es/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.
