> For the complete documentation index, see [llms.txt](https://docs.keeper.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keeper.io/keeperpam/jp/commander-sdk/keeper-commander-sdks/sdk-command-reference/pedm-commands/pedm-collection-commands.md).

# KEPMコレクションコマンド

### 概要

ここでは、KEPMコレクションを管理するKeeperコマンダーのコマンドを扱います。コレクションは、ポリシーフィルターで利用できるユーザー、マシン、アプリケーション、その他のエンティティなどのリソースをまとめます。これらのコマンドで、コレクションの作成・表示・更新・削除や、コレクションと他のKEPMエンティティとのリンク管理が行えます。

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

* [**コレクション一覧コマンド**](#collection-list-command)
* [**コレクション参照コマンド**](#collection-view-command)
* [**コレクション追加コマンド**](#collection-add-command)
* [**コレクション更新コマンド**](#collection-update-command)
* [**コレクション削除コマンド**](#collection-delete-command)
* [**コレクション接続コマンド**](#collection-connect-command)
* [**コレクション切断コマンド**](#collection-disconnect-command)
* [**コレクション一括削除コマンド**](#collection-wipe-out-command)

### 使い方

`pedm collection command [--options]` または `pedm c command [--options]`

**別名:** `c`

***

### コレクション一覧コマンド <a href="#collection-list-command" id="collection-list-command"></a>

すべてのKEPMコレクションを、タイプまたは検索パターンによる任意の絞り込みとともに表示します。コレクションは、OSビルド、アプリケーション、ユーザーアカウント、グループアカウント、カスタムコレクションなど、さまざまなリソースタイプを表せます。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `epm-collection list`

**パラメータ**:

<table><thead><tr><th width="211">パラメータ</th><th>説明</th></tr></thead><tbody><tr><td><code>--type</code></td><td>コレクションタイプ番号での絞り込み</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```bash
My Vault > epm-collection list
My Vault > epm-collection list --type 2
```

{% endcode %}

</details>

<details>

<summary>DotNet SDK</summary>

**関数:**

{% code expandable="true" %}

```csharp
// Get all collections
IEnumerable<EpmCollection> allCollections = plugin.Collections.GetAll();

// Filter by type
var appCollections = plugin.Collections.GetAll()
    .Where(c => c.CollectionType == (int)EpmCollectionType.Application);

// Get a single collection by UID
EpmCollection collection = plugin.Collections.GetEntity(collectionUid);

// Read decoded name from collection data
string name = "";
if (collection.CollectionData != null && collection.CollectionData.Length > 0)
{
    var data = JsonUtils.ParseJson<Dictionary<string, object>>(collection.CollectionData);
    if (data.TryGetValue("Name", out var nameObj))
        name = nameObj?.ToString();
}
```

{% endcode %}

</details>

<details>

<summary>Power Commander</summary>

**コマンド:** `Get-KeeperEpmCollectionList`

**別名**: `kepm-collection-list`

**パラメータ**:

<table><thead><tr><th width="235">パラメータ</th><th>説明</th></tr></thead><tbody><tr><td><code>-CollectionType</code></td><td>コレクションタイプ番号での絞り込み</td></tr></tbody></table>

**コレクションタイプ:**

| 値   | 名称            |
| --- | ------------- |
| 1   | OS Build      |
| 2   | Application   |
| 3   | User Account  |
| 4   | Group Account |
| 202 | OS Version    |

**例**:

{% code expandable="true" %}

```ps1
PS > Get-KeeperEpmCollectionList
zONY29QGSmCZAQ0l5UXJfA Type 102       TestNEW
0NNRTG9a4JTZ32LzfIO6FQ Type 103       TestBy1
GF2zrxVgl8Pj7dcbh9hJwg OS Version     macOS 26
```

{% endcode %}

</details>

<details>

<summary>Python CLI</summary>

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

**別名:** `pedm c l`, `pedm c list`

**フラグ:**

| フラグ             | 説明                         |
| --------------- | -------------------------- |
| `-v, --verbose` | コレクション詳細情報の表示              |
| `--type`        | コレクションタイプでの絞り込み (整数)       |
| `--pattern`     | コレクション名の検索パターン             |
| `--format`      | 出力形式 (json、csv、tableのいずれか) |
| `--output`      | 指定ファイルへの保存                 |

**例:**

```
My Vault> pedm collection list --type 101

Collection UID: coll_abc123
Value: Name=Windows Servers
Link Count: 5
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

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

plugin = admin_plugin.PedmPlugin(enterprise_loader)
plugin.collections.get_all_entities()
```

</details>

### コレクション参照コマンド <a href="#collection-view-command" id="collection-view-command"></a>

特定のコレクションについて、タイプ、値、エージェント・ポリシー・他のコレクションへの関連リンクを含む詳細を表示します。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `epm-collection view`

**パラメータ**:

<table><thead><tr><th width="194.99993896484375">パラメータ</th><th>説明</th></tr></thead><tbody><tr><td><em>(positional)</em></td><td>コレクションUIDまたは名前 (大文字小文字を区別しない)</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```
My Vault > epm-collection view abc123uid
My Vault > epm-collection view "My Collection"
```

{% endcode %}

</details>

<details>

<summary>DotNet SDK</summary>

**関数:**

{% code expandable="true" %}

```csharp
// Get all collections
IEnumerable<EpmCollection> allCollections = plugin.Collections.GetAll();

// Filter by type
var appCollections = plugin.Collections.GetAll()
    .Where(c => c.CollectionType == (int)EpmCollectionType.Application);

// Get a single collection by UID
EpmCollection collection = plugin.Collections.GetEntity(collectionUid);

// Read decoded name from collection data
string name = "";
if (collection.CollectionData != null && collection.CollectionData.Length > 0)
{
    var data = JsonUtils.ParseJson<Dictionary<string, object>>(collection.CollectionData);
    if (data.TryGetValue("Name", out var nameObj))
        name = nameObj?.ToString();
}
```

{% endcode %}

</details>

<details>

<summary>Power Commander</summary>

**コマンド:** `Get-KeeperEpmCollection`

**別名**: `kepm-collection-view`

**パラメータ**:

<table><thead><tr><th width="287">パラメータ</th><th>説明</th></tr></thead><tbody><tr><td><code>-CollectionUidOrName</code></td><td>コレクションUIDまたは名前 (大文字小文字を区別しない)</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```ps1
PS > Get-KeeperEpmCollection zONY29QGSmCZAQ0l5UXJfA
Collection: zONY29QGSmCZAQ0l5UXJfA
  Type: Type 102
  Created: 2026-05-05 10:42:40
  Name: TestNEW
  IsCustom: True

  Linked Agents (1):
    jhIsUYwxz6Y6cBFHz06Ukw  (OidIJAZhpLwwbsu3TKK_66Ti8ulC8rJKlG1OEdF_IWk)

  Linked Policies (1):
    ebZZya9XhEXvlsUNjtmLcA

  Linked Collections (3):
    EW8bzYtBPJosLtm8C7lNqA
```

{% endcode %}

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `pedm collection view <collection> [collection...]`

**別名:** `pedm c v`, `pedm c view`

**フラグ:**

| フラグ             | 説明                         |
| --------------- | -------------------------- |
| `-v, --verbose` | 詳細情報の表示                    |
| `--link`        | 特定リンクUIDの詳細表示 (繰り返し指定可)    |
| `--format`      | 出力形式 (json、csv、tableのいずれか) |
| `--output`      | 指定ファイルへの保存                 |
| `collection`    | コレクションUID (必須、複数指定可)       |

**例:**

```
My Vault> pedm collection view coll_abc123

Collection UID: coll_abc123
Collection Type: MACHINE (101)
Collection Value: Name=Windows Servers
Link Count: 5
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

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

plugin = admin_plugin.PedmPlugin(enterprise_loader)
plugin.collections.get_entity(uid)
```

</details>

### コレクション追加コマンド <a href="#collection-add-command" id="collection-add-command"></a>

リソースをまとめるカスタムコレクションを新規作成します。ポリシーフィルターで、特定のユーザー・マシン・アプリケーションの集合を対象にするために利用できます。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `epm-collection add`

**パラメータ**:

<table><thead><tr><th width="208.99993896484375">パラメータ</th><th>説明</th></tr></thead><tbody><tr><td><em>(positional)</em></td><td>コレクションUID</td></tr><tr><td><code>--type</code></td><td>コレクションタイプ (1=OS Build, 2=Application, 3=User Account, 4=Group Account, 202=OS Version)</td></tr><tr><td><code>--data</code></td><td>JSON文字列形式のコレクションデータ</td></tr><tr><td><code>--data-file</code></td><td>コレクションデータJSONを含むファイルのパス</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```bash
My Vault > epm-collection add --type 2 --data '{"Name":"Chrome","Version":"120"}'
```

{% endcode %}

</details>

<details>

<summary>DotNet SDK</summary>

**関数:**

{% code expandable="true" %}

```csharp
public async Task<ModifyStatus> ModifyCollections(
    IEnumerable<CollectionData> addCollections = null,
    IEnumerable<CollectionData> updateCollections = null,
    IEnumerable<string> removeCollections = null)
```

{% endcode %}

</details>

<details>

<summary>Power Commander</summary>

**コマンド:** `Add-KeeperEpmCollection`

**別名**: `kepm-collection-add`

**パラメータ**:

<table><thead><tr><th width="217">パラメータ</th><th>説明</th></tr></thead><tbody><tr><td><code>-CollectionUid</code></td><td>コレクションUID</td></tr><tr><td><code>-CollectionType</code></td><td>コレクションタイプ (1=OS Build, 2=Application, 3=User Account, 4=Group Account, 202=OS Version)</td></tr><tr><td><code>-Data</code></td><td>JSON文字列形式のコレクションデータ</td></tr><tr><td><code>-DataFile</code></td><td>コレクションデータJSONを含むファイルのパス</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```ps1
PS >  Add-KeeperEpmCollection -CollectionType 2 -Data '{"Name":"Chrome","Version":"120"}'
Generated Collection UID: tbbwqMM3UbVPD_NQb4JSkQ
Collection 'tbbwqMM3UbVPD_NQb4JSkQ' added.
  Added: tbbwqMM3UbVPD_NQb4JSkQ
```

{% endcode %}

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `pedm collection add <collection_name> [collection_name...]`

**別名:** `pedm c a`, `pedm c add`

**フラグ:**

| フラグ          | 説明                 |
| ------------ | ------------------ |
| `--type`     | コレクションタイプ (必須、整数)  |
| `collection` | コレクション名 (必須、複数指定可) |

**例:**

```
My Vault> pedm collection add "Finance Users" "HR Users" --type 103

Collection created successfully
Collection UID: coll_new123
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

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

plugin = admin_plugin.PedmPlugin(enterprise_loader)

collection: Any = ['Collection names']
collection_type = int #'Collection type'

if isinstance(collection, str):
    collection = [collection]

collections: Dict[str, admin_types.CollectionData] = {}
for c in collection:
    collection_uid = utils.generate_uid()
    collection_data = {
        'Name': c,
        'IsCustom': True
    }
    collections[collection_uid] = admin_types.CollectionData(
        collection_uid=collection_uid, collection_type=collection_type,
        collection_data=json.dumps(collection_data))

status = plugin.modify_collections(add_collections=collections.values())
```

</details>

### コレクション更新コマンド <a href="#collection-update-command" id="collection-update-command"></a>

既存コレクションの名前を変更します。コレクションを作り直したりリンクに影響を与えたりせずに、管理者がコレクション名を更新できます。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `epm-collection update`

**パラメータ**:

<table><thead><tr><th width="194.00006103515625">パラメータ</th><th>説明</th></tr></thead><tbody><tr><td><em>(positional)</em></td><td>コレクションUIDまたは名前 (大文字小文字を区別しない)</td></tr><tr><td><code>--type</code></td><td>新しいコレクションタイプ</td></tr><tr><td><code>--data</code></td><td>JSON文字列形式のコレクションデータ</td></tr><tr><td><code>--data-file</code></td><td>コレクションデータJSONを含むファイルのパス</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```bash
My Vault > epm-collection update abc123uid --data '{"Name":"Chrome","Version":"121"}'
```

{% endcode %}

</details>

<details>

<summary>DotNet SDK</summary>

**関数:**

{% code expandable="true" %}

```csharp
public async Task<ModifyStatus> ModifyCollections(
    IEnumerable<CollectionData> addCollections = null,
    IEnumerable<CollectionData> updateCollections = null,
    IEnumerable<string> removeCollections = null)
```

{% endcode %}

</details>

<details>

<summary>Power Commander</summary>

**コマンド:** `Update-KeeperEpmCollection`

**別名**: `kepm-collection-edit`

**パラメータ**:

<table><thead><tr><th width="218.99993896484375">パラメータ</th><th>説明</th></tr></thead><tbody><tr><td><code>-CollectionUidOrName</code></td><td>コレクションUIDまたは名前 (大文字小文字を区別しない)</td></tr><tr><td><code>-CollectionType</code></td><td>新しいコレクションタイプ</td></tr><tr><td><code>-Data</code></td><td>JSON文字列形式のコレクションデータ</td></tr><tr><td><code>-DataFile</code></td><td>コレクションデータJSONを含むファイルのパス</td></tr></tbody></table>

**例:**

{% code expandable="true" %}

```ps1
PS > Update-KeeperEpmCollection "tbbwqMM3UbVPD_NQb4JSkQ" -Data '{"Name":"Chrome","Version":"121"}'
Collection 'tbbwqMM3UbVPD_NQb4JSkQ' updated.
  Updated: tbbwqMM3UbVPD_NQb4JSkQ
```

{% endcode %}

</details>

<details>

<summary>Python CLI</summary>

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

**別名:** `pedm c u`, `pedm c update`

**フラグ:**

| フラグ          | 説明                    |
| ------------ | --------------------- |
| `--name`     | 新しいコレクション名 (必須)       |
| `--type`     | コレクションタイプ (任意、曖昧さ解消用) |
| `collection` | コレクションUIDまたは名前 (必須)   |

**例:**

```
My Vault> pedm collection update coll_abc123 --name "Updated Server Group"

Collection updated successfully
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

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

plugin = admin_plugin.PedmPlugin(enterprise_loader)

new_name = 'rename collection'
collection_id = 'collection name or uid'
collection = plugin.collections.get_entity(collection_id)
collection_info = collection.collection_data
collection_info['Name'] = new_name
collection_data = admin_types.CollectionData(
    collection_uid=collection.collection_uid, collection_type=collection.collection_type,
    collection_data=json.dumps(collection_info))

status = plugin.modify_collections(update_collections=[collection_data])
```

</details>

### コレクション削除コマンド <a href="#collection-delete-command" id="collection-delete-command"></a>

システムから1つ以上のコレクションを削除します。特定のコレクションの削除に加え、@orphan\_resourceのような特殊値で孤立リソースコレクションを整理することにも対応します。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `epm-collection remove`

**パラメータ**:

<table><thead><tr><th width="194.00006103515625">パラメータ</th><th>説明</th></tr></thead><tbody><tr><td><em>(positional)</em></td><td>コレクションUIDまたは名前 (大文字小文字を区別しない)</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```bash
My Vault > epm-collection delete "My Collection"
```

{% endcode %}

</details>

<details>

<summary>DotNet SDK</summary>

**関数:**

{% code expandable="true" %}

```csharp
public async Task<ModifyStatus> ModifyCollections(
    IEnumerable<CollectionData> addCollections = null,
    IEnumerable<CollectionData> updateCollections = null,
    IEnumerable<string> removeCollections = null)
```

{% endcode %}

</details>

<details>

<summary>Power Commander</summary>

**コマンド:** `Remove-KeeperEpmCollection`

**別名**: `kepm-collection-delete`

**パラメータ**:

<table><thead><tr><th width="244">パラメータ</th><th>説明</th></tr></thead><tbody><tr><td><code>-CollectionUidOrName</code></td><td>コレクションUIDまたは名前 (大文字小文字を区別しない)</td></tr><tr><td><code>-Force</code></td><td>削除前の確認プロンプトのスキップ</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```ps1
PS > Remove-KeeperEpmCollection "tbbwqMM3UbVPD_NQb4JSkQ"

Confirm
Are you sure you want to perform this action?
Performing the operation "Delete" on target "collection 'Chrome'".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y
Collection 'tbbwqMM3UbVPD_NQb4JSkQ' removed.
  Removed: tbbwqMM3UbVPD_NQb4JSkQ
```

{% endcode %}

</details>

<details>

<summary>Python CLI</summary>

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

**別名:** `pedm c delete`

**フラグ:**

| フラグ           | 説明                                              |
| ------------- | ----------------------------------------------- |
| `-f, --force` | 確認プロンプトなし                                       |
| `collection`  | コレクションUIDまたは名前、または @orphan\_resource (必須、複数指定可) |

**例:**

```
My Vault> pedm collection delete coll_old123 --force

Collection deleted successfully
```

```
My Vault> pedm collection delete @orphan_resource

Do you want to remove 3 collection(s)? (y/N): y
Collections deleted successfully
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

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

plugin = admin_plugin.PedmPlugin(enterprise_loader)

collection_id = 'collection name or uid'
collection = plugin.collections.get_entity(collection_id)

uids = [collection.uid]
status = plugin.modify_collections(remove_collections=uids)
```

</details>

### コレクション接続コマンド <a href="#collection-connect-command" id="collection-connect-command"></a>

エンティティ (エージェント、ポリシー、他のコレクション) をコレクションにリンクします。ポリシーフィルターと整理のため、コレクションとPEDMエンティティとの関連付けを行います。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `epm-collection connect`

**パラメータ**:

<table><thead><tr><th width="199">パラメータ</th><th>説明</th></tr></thead><tbody><tr><td><em>(positional)</em></td><td>コレクションUIDまたは名前 (大文字小文字を区別しない)</td></tr><tr><td><code>--link-type</code></td><td>リンクの種類: <code>agent</code>、<code>policy</code>、または <code>collection</code></td></tr><tr><td><code>--link</code></td><td>リンク対象のUIDまたは名前 (複数指定可)</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```bash
My Vault > epm-collection connect abc123uid --link-type agent --link agent-uid-1
```

{% endcode %}

</details>

<details>

<summary>DotNet SDK</summary>

**関数:**

{% code expandable="true" %}

```csharp
public async Task<ModifyStatus> SetCollectionLinks(
    IEnumerable<CollectionLink> setLinks = null,
    IEnumerable<CollectionLink> unsetLinks = null)
```

{% endcode %}

</details>

<details>

<summary>Power Commander</summary>

**コマンド:** `Connect-KeeperEpmCollection`

**別名**: `kepm-collection-connect`

**パラメータ**:

<table><thead><tr><th width="292">パラメータ</th><th>説明</th></tr></thead><tbody><tr><td><code>-CollectionUidOrName</code></td><td>コレクションUIDまたは名前 (大文字小文字を区別しない)</td></tr><tr><td><code>-LinkType</code></td><td>リンクの種類: <code>agent</code>、<code>policy</code>、または <code>collection</code></td></tr><tr><td><code>-LinkUid</code></td><td>リンク対象のUIDまたは名前 (複数指定可)</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```ps1
PS > Connect-KeeperEpmCollection "Xgnlz6kDlNfdf8PlgV30ow" -LinkType agent -LinkUid "ah5j2UEjjDP5Y8oXdNaw3A"
1 link(s) connected.
  Added: Xgnlz6kDlNfdf8PlgV30ow
```

{% endcode %}

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `pedm collection connect <links> [links...]`

**別名:** `pedm c connect`

**フラグ:**

| フラグ                | 説明                                       |
| ------------------ | ---------------------------------------- |
| `-c, --collection` | 親コレクションのUIDまたは名前 (必須)                    |
| `--link-type`      | リンクの種類 (agent、policy、collectionのいずれか、必須) |
| `links`            | リンクUIDまたは名前 (必須、複数指定可)                   |

**例:**

```
My Vault> pedm collection connect agent_abc123 agent_def456 --collection coll_servers --link-type agent

Links created successfully
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

```python
from keepersdk.plugins.pedm import admin_plugin, admin_types
from keepersdk.proto import pedm_pb2

plugin = admin_plugin.PedmPlugin(enterprise_loader)

collection_id = 'collection name or uid'
collection = plugin.collections.get_entity(collection_id)


link_types = ['agent', 'policy', 'collection']
link_type = link_types[0]
link_name = 'link name or uid'

links: List[str] = []
collection_link_type: int
if link_type == 'collection':
    coll_links = plugin.collections.get_entity(link_name)
    links.extend((x.collection_uid for x in coll_links))
    collection_link_type = pedm_pb2.CLT_COLLECTION
elif link_type == 'agent':
    agent = plugin.agents.get_entity(link_name)
    links.append(agent.agent_uid)
    collection_link_type = pedm_pb2.CLT_AGENT
elif link_type == 'policy':
    pol_links = plugin.policies.get_entity(link_name)
    links.extend((x.policy_uid for x in pol_links))
    collection_link_type = pedm_pb2.CLT_POLICY

to_add = [admin_types.CollectionLink(
    collection_uid=collection.collection_uid, link_uid=x, link_type=collection_link_type) for x in links]

status = plugin.set_collection_links(set_links=to_add)
```

</details>

### コレクション切断コマンド <a href="#collection-disconnect-command" id="collection-disconnect-command"></a>

コレクションと関連エンティティの間のリンクを削除します。親コレクションからエージェント・ポリシー・コレクションの紐づけを外しますが、エンティティそのものは削除しません。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `epm-collection disconnect`

**パラメータ**:

<table><thead><tr><th width="200">パラメータ</th><th>説明</th></tr></thead><tbody><tr><td><em>(positional)</em></td><td>コレクションUIDまたは名前 (大文字小文字を区別しない)</td></tr><tr><td><code>--link</code></td><td>切断対象のリンクUID (複数指定可)</td></tr><tr><td><code>-f</code>, <code>--force</code></td><td>確認プロンプトのスキップ</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```bash
My Vault > epm-collection disconnect abc123uid --link agent-uid-1
```

{% endcode %}

</details>

<details>

<summary>DotNet SDK</summary>

**関数:**

{% code expandable="true" %}

```csharp
public async Task<ModifyStatus> SetCollectionLinks(
    IEnumerable<CollectionLink> setLinks = null,
    IEnumerable<CollectionLink> unsetLinks = null)
```

{% endcode %}

</details>

<details>

<summary>Power Commander</summary>

**コマンド:** `Disconnect-KeeperEpmCollection`

**別名**: `kepm-collection-disconnect`

**パラメータ**:

<table><thead><tr><th width="271">パラメータ</th><th>説明</th></tr></thead><tbody><tr><td><code>-CollectionUidOrName</code></td><td>コレクションUIDまたは名前 (大文字小文字を区別しない)</td></tr><tr><td><code>-LinkUid</code></td><td>切断対象のリンクUID (複数指定可)</td></tr><tr><td><code>-Force</code></td><td>確認プロンプトのスキップ</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```ps1
PS > Disconnect-KeeperEpmCollection Xgnlz6kDlNfdf8PlgV30ow -LinkUid "ah5j2UEjjDP5Y8oXdNaw3A"          
      
Confirm
Are you sure you want to perform this action?
Performing the operation "Disconnect" on target "1 link(s) from collection 'Xgnlz6kDlNfdf8PlgV30ow'".   
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y
1 link(s) disconnected.
  Removed: Xgnlz6kDlNfdf8PlgV30ow
```

{% endcode %}

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `pedm collection disconnect <links> [links...]`

**別名:** `pedm c disconnect`

**フラグ:**

| フラグ                | 説明                    |
| ------------------ | --------------------- |
| `-c, --collection` | 親コレクションのUIDまたは名前 (必須) |
| `-f, --force`      | 確認プロンプトなし             |
| `links`            | リンクを外すUID (必須、複数指定可)  |

**例:**

```
My Vault> pedm collection disconnect agent_abc123 --collection coll_servers --force

Links removed successfully
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

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

plugin = admin_plugin.PedmPlugin(enterprise_loader)

collection_id = 'collection name or uid'
collection = plugin.collections.get_entity(collection_id)

existing_links= list(x for x in plugin.storage.collection_links.get_links_by_subject(collection.collection_uid))
links: Any = ['UIDs to unlink']
to_unlink: Set[str] = set(links)

to_remove: List[admin_types.CollectionLink] = []
for link in existing_links:
    link_uid = link.link_uid
    if link_uid in to_unlink:
        to_remove.append(admin_types.CollectionLink(
            collection_uid=collection.collection_uid,
            link_uid=link_uid,
            link_type=link.link_type)
        )

status = plugin.set_collection_links(unset_links=to_remove)
```

</details>

### コレクション一括削除コマンド <a href="#collection-wipe-out-command" id="collection-wipe-out-command"></a>

指定したタイプのコレクションをすべてシステムから削除します。一括整理に役立ちますが、複数のコレクションを恒久削除するため注意して使用してください。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `epm-collection wipe-out`

**パラメータ**:

<table><thead><tr><th width="189.00006103515625">パラメータ</th><th>説明</th></tr></thead><tbody><tr><td><code>--type</code></td><td>ワイプアウト対象のコレクションタイプ (1=OS Build, 2=Application, 3=User Account, 4=Group Account, 202=OS Version)</td></tr></tbody></table>

**コレクションタイプ参照:**

| 値   | 名称            |
| --- | ------------- |
| 1   | OS Build      |
| 2   | Application   |
| 3   | User Account  |
| 4   | Group Account |
| 202 | OS Version    |

**例**:

{% code expandable="true" %}

```bash
My Vault > epm-collection wipe-out --type 2
```

{% endcode %}

</details>

<details>

<summary>DotNet SDK</summary>

**関数:**

{% code expandable="true" %}

```csharp
// 1. Get all collection UIDs of the target type
var collectionUids = plugin.Collections.GetAll()
    .Where(c => c.CollectionType == targetCollectionType)
    .Select(c => c.CollectionUid)
    .ToList();

if (collectionUids.Count == 0)
{
    Console.WriteLine("No collections found for this type.");
    return;
}

// 2. Remove them all via ModifyCollections
ModifyStatus status = await plugin.ModifyCollections(
    addCollections: null,
    updateCollections: null,
    removeCollections: collectionUids);

// 3. Sync to refresh local state
await plugin.SyncDown();
```

{% endcode %}

</details>

<details>

<summary>Power Commander</summary>

**コマンド:** `Remove-KeeperEpmCollectionsByType`

**別名**: `kepm-collection-wipeout`

**パラメータ**:

<table><thead><tr><th width="250.99993896484375">パラメータ</th><th>説明</th></tr></thead><tbody><tr><td><code>-CollectionType</code></td><td>ワイプアウト対象のコレクションタイプ (1=OS Build, 2=Application, 3=User Account, 4=Group Account, 202=OS Version)</td></tr><tr><td><code>-Force</code></td><td>確認プロンプトのスキップ</td></tr></tbody></table>

**例**:

{% code expandable="true" %}

```ps1
PS > Remove-KeeperEpmCollectionsByType 1003

Confirm
Are you sure you want to perform this action?
Performing the operation "Delete" on target "1 Type 1003 collection(s)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y
1 collection(s) removed.
  Removed: gdaQx6wOVGrZharzghi_iA
```

{% endcode %}

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `pedm collection wipe-out`

**別名:** `pedm c wipe-out`

**フラグ:**

| フラグ      | 説明                      |
| -------- | ----------------------- |
| `--type` | ワイプアウト対象のコレクションタイプ (整数) |

**例:**

```
My Vault> pedm collection wipe-out --type 102

All collections of type 102 deleted
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

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

plugin = admin_plugin.PedmPlugin(enterprise_loader)

collection_type = 10 #collection type upto 100
if isinstance(collection_type, int):
    collection_type = [collection_type]
collections: List[str] = []
for coll in plugin.storage.collections.get_all_entities():
    if collection_type and coll.collection_type not in collection_type:
        continue
    collections.append(coll.collection_uid)

plugin.modify_collections(remove_collections=collections)
```

</details>


---

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