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

# PAM Connection Commands

This command will edit the connection parameters and user accounts that are attached to PAM Machine and PAM Database records. The process can also be done in bulk with the run-batch command. To launch

### Connection Edit command

Edits connection settings on PAM resource records (`pamMachine`, `pamDatabase`, `pamDirectory`, etc.) or on a PAM Configuration record. Updates vault fields (protocol, port override, scrollback, admin/launch credentials).

<details>

<summary>DotNet CLI</summary>

**Command**: `pam-connection edit`

**Alias**: `pam-conn edit` / `pam-conn e`

**Parameters**:

<table data-search="false"><thead><tr><th width="268">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>&#x3C;record></code> (positional)</td><td>PAM resource or PAM Configuration UID / title</td></tr><tr><td><code>--configuration</code>, <code>-c</code></td><td>PAM Configuration UID or title (required when the resource is not already linked)</td></tr><tr><td><code>--admin-user</code>, <code>-a</code></td><td>PAM User UID/title for the admin credential on the resource</td></tr><tr><td><code>--launch-user</code></td><td>PAM User UID/title for the launch credential</td></tr><tr><td><code>--clear-launch-user</code></td><td>Remove the launch credential from the resource (<code>pamMachine</code> / <code>pamDatabase</code> / <code>pamDirectory</code> only)</td></tr><tr><td><code>--protocol</code>, <code>-p</code></td><td>Connection protocol (e.g. <code>ssh</code>, <code>rdp</code>, <code>mysql</code>, <code>postgresql</code>, <code>sql-server</code>, <code>telnet</code>, <code>vnc</code>, <code>http</code>, <code>kubernetes</code>). Empty string clears</td></tr><tr><td><code>--connections</code></td><td>Connections permission: <code>on</code>, <code>off</code>, or <code>default</code></td></tr><tr><td><code>--connections-recording</code></td><td>Session recording: <code>on</code>, <code>off</code>, or <code>default</code></td></tr><tr><td><code>--typescript-recording</code></td><td>TypeScript recording: <code>on</code>, <code>off</code>, or <code>default</code></td></tr><tr><td><code>--connections-override-port</code></td><td>Port override for connections. Empty string clears</td></tr><tr><td><code>--key-events</code>, <code>-k</code></td><td>Key events (<code>recordingIncludeKeys</code>): <code>on</code>, <code>off</code>, or <code>default</code></td></tr><tr><td><code>--scrollback</code></td><td>Terminal scrollback size. Empty string clears</td></tr><tr><td><code>--rotate-on-termination</code></td><td>Rotate launch credentials when the session ends: <code>on</code> or <code>off</code> (<code>pamMachine</code> / <code>pamDatabase</code> / <code>pamDirectory</code> only)</td></tr><tr><td><code>--silent</code>, <code>-s</code></td><td>Suppress summary output</td></tr></tbody></table>

**Examples**:

{% code expandable="true" %}

```csharp
My Vault> pam-connection edit <RESOURCE_UID> --configuration <CONFIG_UID> --connections=on --protocol ssh
My Vault> pam-connection edit <RESOURCE_UID> --admin-user <PAM_USER_UID> --launch-user <PAM_USER_UID>
My Vault> pam-connection edit <RESOURCE_UID> --connections-recording=on --key-events=on
My Vault> pam-connection edit <RESOURCE_UID> --connections-override-port 2222 --scrollback 1000
My Vault> pam-connection edit <RESOURCE_UID> --rotate-on-termination=on
My Vault> pam-connection edit <RESOURCE_UID> --clear-launch-user
My Vault> pam-connection edit <CONFIG_UID> --connections=on
My Vault> pam-conn e <RESOURCE_UID> -c <CONFIG_UID> --connections=on -p ssh
```

{% endcode %}

</details>

<details>

<summary>DotNet SDK</summary>

**Function:**

```csharp
using KeeperSecurity.Plugins.PAM;

var result = await ConnectionUtils.EditConnectionAsync(vault, new PamConnectionEditOptions
{
    Record = "<RESOURCE_UID>",
    Configuration = "<CONFIG_UID>",
    Connections = "on",
    Protocol = "ssh",
    AdminUser = "<PAM_USER_UID>",
    LaunchUser = "<PAM_USER_UID>",
    ConnectionsRecording = "on",
    TypescriptRecording = "default",
    ConnectionsOverridePort = "2222",
    KeyEvents = "on",
    Scrollback = "1000",
    RotateOnTermination = "on",
    Silent = false
});

foreach (var message in result.Messages)
{
    Console.WriteLine(message);
}

if (result.RecordUpdated || result.GraphUpdated)
{
    Console.WriteLine($"Connection settings updated for {result.RecordUid}");
}
```

</details>

<details>

<summary>Power Commander</summary>

**Command**: `Set-KeeperPamConnection`

**Alias**: `pam-connection-edit`

**Parameters**:

<table data-search="false"><thead><tr><th width="268">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>-Record</td><td>PAM resource or PAM Configuration UID / title</td></tr><tr><td><code>-Configuration</code>, <code>-c</code></td><td>PAM Configuration UID/title</td></tr><tr><td><code>-AdminUser</code>, <code>-a</code></td><td>PAM User for admin credential</td></tr><tr><td><code>-LaunchUser, -lu</code></td><td>PAM User UID/title for the launch credential</td></tr><tr><td><code>-ClearLaunchUser</code></td><td>Remove launch credential</td></tr><tr><td><code>-Protocol</code>, <code>-p</code></td><td>Connection protocol (e.g. <code>ssh</code>, <code>rdp</code>, <code>mysql</code>, <code>postgresql</code>, <code>sql-server</code>, <code>telnet</code>, <code>vnc</code>, <code>http</code>, <code>kubernetes</code>). Empty string clears</td></tr><tr><td><code>-Connections, -cn</code></td><td>Connections permission: <code>on</code>, <code>off</code>, or <code>default</code></td></tr><tr><td><code>-ConnectionsRecording, -cr</code></td><td>Session recording: <code>on</code>, <code>off</code>, or <code>default</code></td></tr><tr><td><code>-TypescriptRecording, -tr</code></td><td>TypeScript recording: <code>on</code>, <code>off</code>, or <code>default</code></td></tr><tr><td><code>-ConnectionsOverridePort, -cop</code></td><td>Port override for connections. Empty string clears</td></tr><tr><td><code>-KeyEvents</code>, <code>-k</code></td><td>Key events: <code>on</code>, <code>off</code>, or <code>default</code></td></tr><tr><td><code>-Scrollback, -sb</code></td><td>Terminal scrollback size. Empty string clears</td></tr><tr><td><code>-RotateOnTermination</code></td><td>Rotate launch credentials when the session ends: <code>on</code> or <code>off</code> (<code>pamMachine</code> / <code>pamDatabase</code> / <code>pamDirectory</code> only)</td></tr><tr><td><code>-Silent</code>, <code>-s</code></td><td>Suppress final update line</td></tr></tbody></table>

**Examples:**

```powershell
PS > Set-KeeperPamConnection -Record "DkPBB1AuaHpt8JQ-jTLEEw" -Configuration "fTKLyvpZsuabGJiRuut40g" `
  -AdminUser "dy3D5Uky_soUveE3TpMLaQ" -Protocol ssh -Connections on -ConnectionsRecording on -ConnectionsOverridePort 22
Connection settings updated for DkPBB1AuaHpt8JQ-jTLEEw

PS > pam-connection-edit -r "DxtvucKwfKCM9YCH1iuTCg" -c "fTKLyvpZsuabGJiRuut40g" `
  -a "q6bWilZxKHjW5F3LySI2wQ" -lu "iqqtWcC146Te5eCXC-Uztw" -p rdp -cn on -cr on -cop 3389

PS > Set-KeeperPamConnection -Record "DkPBB1AuaHpt8JQ-jTLEEw" -ClearLaunchUser -Silent


```

</details>

<details>

<summary>Python CLI</summary>

**Command: Coming Soon**

</details>

<details>

<summary>Python SDK</summary>

**Command: Coming Soon**

</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 by asking a question.

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

```
GET https://newdocs.keeper.io/en/keeperpam/commander-sdk/keeper-commander-sdks/sdk-command-reference/keeperpam-commands/pam-connection-commands.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.
