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

# Active Directory PowerShell モジュール

Active Directory PowerShell モジュールの列挙、Kerberos、資格情報、ACL の悪用、横展開、悪用のワークフロー、検証手順を扱う Active Directory セキュリティメモ。

### 目的

Active Directory モジュールを使用すると、次のようなコマンドを使用できます:

{% code overflow="wrap" %}

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

{% endcode %}

ドメイン コントローラーでは、このモジュールは通常、既定で利用できます。

従来の Windows 10 マシンでは、多くの場合インストールされていません。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-e835a3ce5c62ea2994d99d4e14d71d87c29254d2%2Fimage%20(3200).png?alt=media" alt=""><figcaption></figcaption></figure>

### ドメイン情報を読み込む

ドメイン コントローラー上で:

```bash
Get-ADDomain
```

このコマンドは、次のような重要な情報を返します:

* ドメイン名;
* ドメインの SID;
* ドメインの機能モード;
* フォレスト;
* プライマリ ドメイン コントローラー;
* インフラストラクチャ マスター;
* AD 構成情報。

### RSAT がないマシンでモジュールを使用する

DLL は 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 %}

次に、それをコピーします `WS02`、その後インポートします:

{% code overflow="wrap" %}

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

{% endcode %}

その後、テストできます:

{% code overflow="wrap" %}

```powershell
Get-ADDomain
```

{% endcode %}

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-df6f8940343be30bf005b7e63a7dd5947696fb56%2Fimage%20(3201).png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
