# PEDMエージェントコマンド

### 概要

ここでは、PEDMエージェントを管理するKeeperコマンダーのコマンドを扱います。エージェントはエンドポイントに導入され、特権昇格および委任管理 (PEDM)システムと通信して特権昇格ポリシーを適用します。これらのコマンドで、管理者はエージェントの状態確認、設定変更、エージェントに紐づくリソースコレクションの管理が行えます。

このセクションで扱うコマンドは以下のとおりです。

* [**エージェント一覧コマンド**](#agent-list-command)
* [**エージェント編集コマンド**](#agent-edit-command)
* [**エージェント削除コマンド**](#agent-delete-command)
* [**エージェントのコレクション表示コマンド**](#agent-collection-command)

### 使い方

`pedm agent command [--options]` または `pedm a command [--options]`

**エイリアス:** `a`

***

### エージェント一覧コマンド <a href="#agent-list-command" id="agent-list-command"></a>

登録済みのPEDMエージェントを、エージェントUID、マシン名、デプロイ割り当て、状態、作成日を含む詳細とともに表示します。PEDMエージェントが導入された全エンドポイントの概要を確認できます。

<details>

<summary>DotNet CLI</summary>

**コマンド:** 近日公開

</details>

<details>

<summary>DotNet SDK</summary>

**関数:** 近日公開

</details>

<details>

<summary>Power Commander</summary>

**コマンド:** 近日公開

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `pedm agent list`

**エイリアス:** `pedm a l`, `pedm a list`

**フラグ:**

| フラグ             | 説明                         |
| --------------- | -------------------------- |
| `-v, --verbose` | 稼働状態やプロパティを含む詳細情報を表示する     |
| `--format`      | 出力形式 - json、csv、tableのいずれか |
| `--output`      | 指定ファイルに保存する                |

**例:**

```
My Vault> pedm agent list

Agent UID: agent_abc123
Machine Name: SERVER-001
Deployment: Production
Disabled: False
Created: 2024-10-20
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

```python
from keepersdk.plugins.pedm import admin_plugin

plugin = admin_plugin.PedmPlugin(enterprise_loader)
agent_list = plugin.agents.get_all_entities()
```

</details>

### エージェント編集コマンド <a href="#agent-edit-command" id="agent-edit-command"></a>

PEDMエージェントの有効/無効の切り替えやデプロイ間の移動など、エージェントの構成を変更します。エンドポイントでエージェントを再インストールせずに、管理者が設定を更新できます。

<details>

<summary>DotNet CLI</summary>

**コマンド:** 近日公開

</details>

<details>

<summary>DotNet SDK</summary>

**関数:** 近日公開

</details>

<details>

<summary>Power Commander</summary>

**コマンド:** 近日公開

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `pedm agent edit <agent> [agent...]`

**エイリアス:** `pedm a e`, `pedm a edit`

**フラグ:**

| フラグ            | 説明                                  |
| -------------- | ----------------------------------- |
| `--enable`     | エージェントの有効化または無効化 (choices: on, off) |
| `--deployment` | 指定したデプロイUIDへエージェントを移動する             |
| `agent`        | エージェントUID (必須、複数指定可)                |

**例:**

```
My Vault> pedm agent edit agent_abc123 --enable on --deployment prod_deploy_123

Agent updated successfully
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

```python
from keepersdk.plugins.pedm import admin_plugin

plugin = admin_plugin.PedmPlugin(enterprise_loader)

agent_id = 'agent name or uid'
deployment_id = 'deployment name or id'
deployment = plugin.deployments.get_entity(deployment_id)

agent = plugin.agents.get_entity(agent_id)

update_agents: List[admin_types.UpdateAgent] = []
update_agents.append(admin_types.UpdateAgent(
                    agent_uid=agent.agent_uid,
                    deployment_uid=deployment.deployment_uid,
                    disabled=disabled,
                ))
                
response = plugin.modify_agents(update_agents=update_agents)
```

</details>

### エージェント削除コマンド <a href="#agent-delete-command" id="agent-delete-command"></a>

システムから1つ以上のPEDMエージェントを削除します。このコマンドはPEDM管理システムからエージェントの登録を恒久削除しますが、エンドポイント上のエージェントソフトウェアのアンインストールは行いません。

<details>

<summary>DotNet CLI</summary>

**コマンド:** 近日公開

</details>

<details>

<summary>DotNet SDK</summary>

**関数:** 近日公開

</details>

<details>

<summary>Power Commander</summary>

**コマンド:** 近日公開

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `pedm agent delete <agent> [agent...]`

**エイリアス:** `pedm a delete`

**フラグ:**

| フラグ       | 説明                   |
| --------- | -------------------- |
| `--force` | 確認プロンプトを出さずに実行する     |
| `agent`   | エージェントUID (必須、複数指定可) |

**例:**

```
My Vault> pedm agent delete agent_old123 --force

Agent deleted successfully
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

```python
from keepersdk.plugins.pedm import admin_plugin

plugin = admin_plugin.PedmPlugin(enterprise_loader)

agent_id = 'agent name or uid'
agent = plugin.agents.get_entity(agent_id)

response = plugin.modify_agents( remove_agents=[agent.agent_uid])
```

</details>

### エージェントのコレクション表示コマンド <a href="#agent-collection-command" id="agent-collection-command"></a>

特定のエージェントに紐づくリソースコレクションを表示します。エージェントで検出・登録されたリソースタイプ (OSビルド、アプリケーション、ユーザーアカウントなど)をすべて表示します。

<details>

<summary>DotNet CLI</summary>

**コマンド:** 近日公開

</details>

<details>

<summary>DotNet SDK</summary>

**関数:** 近日公開

</details>

<details>

<summary>Power Commander</summary>

**コマンド:** 近日公開

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `pedm agent collection <agent>`

**エイリアス:** `pedm a c`, `pedm a collection`

**フラグ:**

| フラグ             | 説明                         |
| --------------- | -------------------------- |
| `-v, --verbose` | コレクションの値を含む詳細情報を表示する       |
| `--type`        | コレクションタイプで絞り込む (整数)        |
| `--format`      | 出力形式 - json、csv、tableのいずれか |
| `--output`      | 指定ファイルに保存する                |
| `agent`         | エージェントUID (必須)             |

**例:**

```
My Vault> pedm agent collection agent_abc123

Collection Type: OS_BUILD (1)
Count: 3

Collection Type: APPLICATION (2)
Count: 12
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

```python
from keepersdk.plugins.pedm import admin_plugin

plugin = admin_plugin.PedmPlugin(enterprise_loader)

agent_id = 'agent name or uid'
agent = plugin.agents.get_entity(agent_id)

resource_uids = {x.collection_uid for x in plugin.storage.collection_links.get_links_by_object(agent.agent_uid)}
collections = [plugin.collections.get_entity(x) or x for x in resource_uids]
```

</details>


---

# 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://docs.keeper.io/keeperpam/jp/commander-sdk/keeper-commander-sdks/sdk-command-reference/pedm-commands/pedm-agent-commands.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.
