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

# Модуль PowerShell для Active Directory

### Цель

Модуль Active Directory позволяет использовать такие команды, как:

{% code overflow="wrap" %}

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

{% endcode %}

На контроллере домена этот модуль обычно доступен по умолчанию.

На обычном компьютере с Windows 10 он часто не установлен.

<figure><img src="/files/4dfaf40eeef0111a0bb3d320c01aef07d9673dc3" alt=""><figcaption></figcaption></figure>

### Загрузка сведений о домене

На контроллере домена:

```bash
Get-ADDomain
```

Эта команда возвращает важную информацию, такую как:

* имя домена;
* SID домена;
* функциональный режим домена;
* лес;
* первичный контроллер домена;
* мастер инфраструктуры;
* сведения о конфигурации AD.

### Использование модуля на компьютере без RSAT

DLL можно получить с контроллера домена:

{% 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 %}

Затем мы копируем его в `WS02`, затем импортируем его:

{% code overflow="wrap" %}

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

{% endcode %}

Затем мы можем проверить:

{% code overflow="wrap" %}

```powershell
Get-ADDomain
```

{% endcode %}

<figure><img src="/files/8ca4434eed5b74e9fa3e297dfef56fe45875c568" alt=""><figcaption></figcaption></figure>

### Альтернатива с PowerView

Без модуля Active Directory PowerView предлагает аналогичные команды.

Получить сведения о домене:

{% code overflow="wrap" %}

```powershell
Get-NetDomain
```

{% endcode %}

Получить политику домена:

{% code overflow="wrap" %}

```powershell
Get-DomainPolicy
```

{% endcode %}

Отобразить `SystemAccess` раздел:

{% code overflow="wrap" %}

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

{% endcode %}

Это позволяет получить такие сведения, как:

* политика паролей;
* блокировка учетной записи;
* максимальный срок действия пароля;
* параметры безопасности домена.


---

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