> 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/commander-sdk/keeper-commander-sdks/sdk-command-reference/device-commands/device-action-commands.md).

# Device Action Commands

Perform actions on devices associated with the current user

### Overview

Perform actions on your devices such as logout, remove, lock, unlock, account-lock, account-unlock, link, and unlink.

### Supported actions

* [Device logout](#device-logout-command)
* [Device remove](#device-remove-command)
* [Device lock](#device-lock-command)
* [Device unlock](#device-unlock-command)
* [Device account-lock](#device-account-lock-command)
* [Device account-unlock](#device-account-unlock-command)
* [Device link](#device-link-command)
* [Device unlink](#device-unlink-command)

### Device logout

Logout the user from one or more devices.

<details>

<summary>DotNet CLI</summary>

Coming Soon

</details>

<details>

<summary>DotNet SDK</summary>

Coming Soon

</details>

<details>

<summary>PowerCommander</summary>

Coming Soon

</details>

<details>

<summary>Python CLI</summary>

**Command:** `device-action logout`

**Parameters:**

* `devices` Device IDs (1, 2, 3...) or device names

**Example:**

```bash
My Vault> device-action logout 1
✓ Device 'My iPhone' successfully logged out
```

</details>

<details>

<summary>Python SDK</summary>

**Function:** `logout_user_devices`

**Parameters:**

* `auth` Logged-in `KeeperAuth` session
* `device_identifiers` One or more device IDs or exact device names

**Example:**

```python
from keepersdk.authentication import device_management

device_identifiers = ['1']  # device ID or exact device name
names = device_management.logout_user_devices(auth, device_identifiers)
for name in names:
    print(f"Device '{name}' successfully logged out")
```

</details>

### Device remove

Logout & remove the user from one or more devices.

<details>

<summary>DotNet CLI</summary>

Coming Soon

</details>

<details>

<summary>DotNet SDK</summary>

Coming Soon

</details>

<details>

<summary>PowerCommander</summary>

Coming Soon

</details>

<details>

<summary>Python CLI</summary>

**Command:** `device-action remove`

**Parameters:**

* `devices` Device IDs (1, 2, 3...) or device names

**Example:**

```bash
My Vault> device-action remove "Home Desktop"
✓ Device 'Home Desktop' successfully removed
```

</details>

<details>

<summary>Python SDK</summary>

**Function:** `remove_user_devices`

**Parameters:**

* `auth` Logged-in `KeeperAuth` session
* `device_identifiers` One or more device IDs or exact device names

**Example:**

```python
from keepersdk.authentication import device_management

device_identifiers = ['2', 'Work Laptop']  # one or more devices
names = device_management.remove_user_devices(auth, device_identifiers)
for name in names:
    print(f"Device '{name}' successfully removed")
```

</details>

### Device lock

Locks one or more devices for all the users and logout.

<details>

<summary>DotNet CLI</summary>

Coming Soon

</details>

<details>

<summary>DotNet SDK</summary>

Coming Soon

</details>

<details>

<summary>PowerCommander</summary>

Coming Soon

</details>

<details>

<summary>Python CLI</summary>

**Command:** `device-action lock`

**Parameters:**

* `devices` Device IDs (1, 2, 3...) or device names

**Example:**

```bash
My Vault> device-action lock "Work Laptop"
✓ Device 'Work Laptop' successfully locked
```

</details>

<details>

<summary>Python SDK</summary>

**Function:** `lock_user_devices`

**Parameters:**

* `auth` Logged-in `KeeperAuth` session
* `device_identifiers` One or more device IDs or exact device names

**Example:**

```python
from keepersdk.authentication import device_management

device_identifiers = ['1']
names = device_management.lock_user_devices(auth, device_identifiers)
for name in names:
    print(f"Device '{name}' successfully locked")
```

</details>

### Device unlock

Unlocks one or more devices, plus any linked devices, for the current user.

<details>

<summary>DotNet CLI</summary>

Coming Soon

</details>

<details>

<summary>DotNet SDK</summary>

Coming Soon

</details>

<details>

<summary>PowerCommander</summary>

Coming Soon

</details>

<details>

<summary>Python CLI</summary>

**Command:** `device-action unlock`

**Parameters:**

* `devices` Device IDs (1, 2, 3...) or device names

**Example:**

```bash
My Vault> device-action unlock 1 2
 Device 'My iPhone' successfully unlocked
 Device 'Work Laptop' successfully unlocked
```

</details>

<details>

<summary>Python SDK</summary>

**Function:** `unlock_user_devices`

**Parameters:**

* `auth` Logged-in `KeeperAuth` session
* `device_identifiers` One or more device IDs or exact device names

**Example:**

```python
from keepersdk.authentication import device_management

device_identifiers = ['1']
names = device_management.unlock_user_devices(auth, device_identifiers)
for name in names:
    print(f"Device '{name}' successfully unlocked")
```

</details>

### Device account-lock

Locks one or more devices for the current user only. If the user is logged in, they are logged out.

<details>

<summary>DotNet CLI</summary>

Coming Soon

</details>

<details>

<summary>DotNet SDK</summary>

Coming Soon

</details>

<details>

<summary>PowerCommander</summary>

Coming Soon

</details>

<details>

<summary>Python CLI</summary>

**Command:** `device-action account-lock`

**Parameters:**

* `devices` Device IDs (1, 2, 3...) or device names

**Example:**

```bash
My Vault> device-action account-lock "My iPhone"
✓ Device 'My iPhone' successfully account-locked
```

</details>

<details>

<summary>Python SDK</summary>

**Function:** `account_lock_user_devices`

**Parameters:**

* `auth` Logged-in `KeeperAuth` session
* `device_identifiers` One or more device IDs or exact device names

**Example:**

```python
from keepersdk.authentication import device_management

device_identifiers = ['1']
names = device_management.account_lock_user_devices(auth, device_identifiers)
for name in names:
    print(f"Device '{name}' successfully account locked")
```

</details>

### Device account-unlock

Unlocks one or more devices for the current user.

<details>

<summary>DotNet CLI</summary>

Coming Soon

</details>

<details>

<summary>DotNet SDK</summary>

Coming Soon

</details>

<details>

<summary>PowerCommander</summary>

Coming Soon

</details>

<details>

<summary>Python CLI</summary>

**Command:** `device-action account-unlock`

**Parameters:**

* `devices` Device IDs (1, 2, 3...) or device names

**Example:**

```bash
My Vault> device-action account-unlock 1
✓ Device 'My iPhone' successfully account-unlocked
```

</details>

<details>

<summary>Python SDK</summary>

**Function:** `account_unlock_user_devices`

**Parameters:**

* `auth` Logged-in `KeeperAuth` session
* `device_identifiers` One or more device IDs or exact device names

**Example:**

```python
from keepersdk.authentication import device_management

device_identifiers = ['1']
names = device_management.account_unlock_user_devices(auth, device_identifiers)
for name in names:
    print(f"Device '{name}' successfully account unlocked")
```

</details>

### Device link

Links two or more devices together.

<details>

<summary>DotNet CLI</summary>

Coming Soon

</details>

<details>

<summary>DotNet SDK</summary>

Coming Soon

</details>

<details>

<summary>PowerCommander</summary>

Coming Soon

</details>

<details>

<summary>Python CLI</summary>

**Command:** `device-action link`

**Parameters:**

* `devices` Two or more device IDs or exact device names

**Example:**

```bash
My Vault> device-action link 1 2 3
✓ Device 'My iPhone' successfully linked
✓ Device 'Work Laptop' successfully linked
✓ Device 'Home Desktop' successfully linked
```

{% hint style="info" %}
Linked devices share login and logout behavior when persistent login is enabled.
{% endhint %}

</details>

<details>

<summary>Python SDK</summary>

**Function:** `link_user_devices`

**Parameters:**

* `auth` Logged-in `KeeperAuth` session
* `device_identifiers` Two or more device IDs or exact device names

**Example:**

```python
from keepersdk.authentication import device_management

# At least 2 devices required
device_identifiers = ['1', '2']
names = device_management.link_user_devices(auth, device_identifiers)
for name in names:
    print(f"Device '{name}' successfully linked")
```

</details>

### Device unlink

Unlinks two or more previously linked devices.

<details>

<summary>DotNet CLI</summary>

Coming Soon

</details>

<details>

<summary>DotNet SDK</summary>

Coming Soon

</details>

<details>

<summary>PowerCommander</summary>

Coming Soon

</details>

<details>

<summary>Python CLI</summary>

**Command:** `device-action unlink`

**Parameters:**

* `action` Must be `unlink`
* `devices` One or more devices to unlink. At least 2 devices are required. Each device can be specified as a device ID from `device-list` or an exact device name. Matching is case-insensitive. All-digit values such as `01` are treated as list IDs, not names.

**Options:**

* `--help`, `-h` Show help for the unlink action. Usage: `device-action unlink --help`

**Example:**

```bash
My Vault> device-list

User Devices (3 found)
====================================================================================================
ID   Device Name            Client Type   Login Status   Last Accessed
---- ---------------------- ------------- -------------- -------------------
1    MacBook Pro            Desktop       Logged In      2026-07-01 10:30:00
2    iPhone 15              Mobile        Logged In      2026-06-28 14:22:00
3    Work Laptop            Desktop       Logged Out     2026-06-25 09:15:00

My Vault> device-action unlink 1 2

Device 'MacBook Pro' successfully unlinked
Device 'iPhone 15' successfully unlinked

Updated User Devices (3 found)
====================================================================================================
ID   Device Name            Client Type   Login Status   Last Accessed
---- ---------------------- ------------- -------------- -------------------
1    MacBook Pro            Desktop       Logged In      2026-07-01 10:30:00
2    iPhone 15              Mobile        Logged Out     2026-06-28 14:22:00
3    Work Laptop            Desktop       Logged Out     2026-06-25 09:15:00
```

</details>

<details>

<summary>Python SDK</summary>

**Function:** `unlink_user_devices`

**Parameters:**

* `auth` Logged-in `KeeperAuth` session
* `device_identifiers` Two or more device IDs or exact device names

**Example:**

```python
from keepersdk.authentication import device_management

# At least 2 devices required
device_identifiers = ['1', '2']
names = device_management.unlink_user_devices(auth, device_identifiers)
for name in names:
    print(f"Device '{name}' successfully unlinked")
```

</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://docs.keeper.io/keeperpam/commander-sdk/keeper-commander-sdks/sdk-command-reference/device-commands/device-action-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.
