# KEPM Deployment Commands

### Overview

This section covers all the Keeper Commander commands for managing KEPM agent deployments. Deployments represent agent deployment configurations and provide the tokens needed to install and register KEPM agents on endpoints. These commands allow administrators to create, view, update, and delete deployment configurations.

This section supports the following commands:

[**Deployment List Command**](#deployment-list-command)

[**Deployment Add Command**](#deployment-add-command)

[**Deployment Edit Command**](#deployment-edit-command)

[**Deployment Delete Command**](#deployment-delete-command)

[**Deployment Download Command**](#deployment-download-command)

### Usage

`pedm deployment command [--options]` OR `pedm d command [--options]`

**Alias:** `d`

***

### Deployment List Command

View all KEPM deployments with their details including deployment UID, name, status, creation date, and associated agent count. Useful for monitoring and managing multiple deployment configurations across the organisation.

<details>

<summary>DotNet CLI</summary>

**Command:** Coming Soon

</details>

<details>

<summary>DotNet SDK</summary>

**Function:** Coming Soon

</details>

<details>

<summary>Power Commander</summary>

**Command:** Coming Soon

</details>

<details>

<summary>Python SDK</summary>

**Function:**

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

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

</details>

### Deployment Add Command

Create a new KEPM deployment configuration. This command generates a unique deployment token that can be used to install and register KEPM agents on endpoints. The deployment serves as a logical grouping for agents.

<details>

<summary>DotNet CLI</summary>

**Command:** Coming Soon

</details>

<details>

<summary>DotNet SDK</summary>

**Function:** Coming Soon

</details>

<details>

<summary>Power Commander</summary>

**Command:** Coming Soon

</details>

<details>

<summary>Python SDK</summary>

**Function:**

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

deployment_name = 'deployment name'
plugin = admin_plugin.PedmPlugin(enterprise_loader)

ec_public_key = crypto.unload_ec_public_key(enterprise_data.enterprise_info.ec_public_key)
agent_info = pedm_shared.DeploymentAgentInformation(hash_key=plugin.agent_key, peer_public_key=ec_public_key)
spiffe_cert = cert.public_bytes(serialization.Encoding.DER)

add_rq = admin_types.AddDeployment(name=deployment_name, spiffe_cert=spiffe_cert, agent_info=agent_info)
response = plugin.modify_deployments(add_deployments=[add_rq])
```

</details>

### Deployment Edit Command

Modify an existing KEPM deployment's settings such as name or enabled/disabled status. This command allows administrators to update deployment configurations without recreating them.

<details>

<summary>DotNet CLI</summary>

**Command:** Coming Soon

</details>

<details>

<summary>DotNet SDK</summary>

**Function:** Coming Soon

</details>

<details>

<summary>Power Commander</summary>

**Command:** Coming Soon

</details>

<details>

<summary>Python SDK</summary>

**Function:**

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

deployment_name = 'deployment name'
plugin = admin_plugin.PedmPlugin(enterprise_loader)

deployment = plugin.deployments.get_entity(deployment_name)
spiffe_cert = cert.public_bytes(serialization.Encoding.DER)

name= 'new name'
disable = True ## or false
update_rq = admin_types.UpdateDeployment(
            deployment_uid=deployment.deployment_uid, name=name, disabled=disabled, spiffe_cert=spiffe_cert)
response = plugin.modify_deployments(update_deployments=[update_rq])
```

</details>

### Deployment Delete Command

Remove one or more KEPM deployments from the system. This command permanently deletes deployment configurations and should be used with caution, especially when agents are still associated with the deployment.

<details>

<summary>DotNet CLI</summary>

**Command:** Coming Soon

</details>

<details>

<summary>DotNet SDK</summary>

**Function:** Coming Soon

</details>

<details>

<summary>Power Commander</summary>

**Command:** Coming Soon

</details>

<details>

<summary>Python SDK</summary>

**Function:**

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

deployment_name = 'deployment name'
plugin = admin_plugin.PedmPlugin(enterprise_loader)

deployment = plugin.deployments.get_entity(deployment_name)
response = plugin.modify_deployments(remove_deployments=[deployment.uid])
```

</details>

### Deployment Download Command

Retrieve the deployment token needed for KEPM agent installation. This command can display the token on screen or save it to a file, and optionally show download URLs for agent installation packages for Windows, MacOS, and Linux platforms.

<details>

<summary>DotNet CLI</summary>

**Command:** Coming Soon

</details>

<details>

<summary>DotNet SDK</summary>

**Function:** Not Supported

</details>

<details>

<summary>Power Commander</summary>

**Command:** Coming Soon

</details>

<details>

<summary>Python SDK</summary>

**Function:** Not Supported

</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/commander-sdk/keeper-commander-sdks/sdk-command-reference/pedm-commands/pedm-deployment-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.
