> 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/device-commands/device-action-commands.md).

# デバイスアクションコマンド

現在のユーザーに関連付けられたデバイスに対してアクションを実行します

### 概要 <a href="#overview" id="overview"></a>

ログアウト、削除、ロック、ロック解除、アカウントロック、アカウントロック解除、リンク、リンク解除など、デバイスに対するさまざまなアクションを実行します。

### 対応アクション <a href="#supported-actions" id="supported-actions"></a>

* [デバイスログアウト](#device-logout-command)
* [デバイス削除](#device-remove-command)
* [デバイスロック](#device-lock-command)
* [デバイスロック解除](#device-unlock-command)
* [デバイスアカウントロック](#device-account-lock-command)
* [デバイスアカウントロック解除](#device-account-unlock-command)
* [デバイスリンク](#device-link-command)
* [デバイスリンク解除](#device-unlink-command)

### デバイスログアウト <a href="#device-logout-command" id="device-logout-command"></a>

1台以上のデバイスからユーザーをログアウトさせます。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `device-action logout`

**パラメータ:**

* devices 1つ以上のデバイスの行ID、完全なデバイストークン、デバイストークンの先頭部分、またはデバイス名 (完全一致)

**例:**

```csharp
My Vault> device-action logout 1
Device 'Work Laptop' successfully logged out
```

</details>

<details>

<summary>DotNet SDK</summary>

**関数:** `ExecuteDeviceAction`

```csharp
var devices = (await auth.GetUserDevices()).ToArray();
var device = devices.First(x => x.DeviceName == "Work Laptop");

var results = await auth.ExecuteDeviceAction(
    DeviceActionType.DaLogout,
    new[] { device.EncryptedDeviceToken });
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Invoke-KeeperDeviceAction`

**エイリアス:** `device-action`

**パラメータ:**

* `-Action` `logout`
* `-Devices` 1つ以上のデバイスの行ID、完全なデバイストークン、デバイストークンの先頭部分、またはデバイス名 (完全一致)
* `-WhatIf` 操作を適用せず、内容のみを確認します
* `-Confirm` 操作を適用する前に確認を求めます

**例:**

```powershell
PS> device-action logout 1
PS> Invoke-KeeperDeviceAction -Action logout -Devices "Work Laptop" -Confirm
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `device-action logout`

**パラメータ:**

* `devices` デバイスID (1、2、3など) またはデバイス名

**例:**

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

</details>

<details>

<summary>Python SDK</summary>

**関数:** `logout_user_devices`

**パラメータ:**

* `auth` ログイン済みの `KeeperAuth` セッション
* `device_identifiers` 1件以上のデバイスID、または完全なデバイス名

**例:**

```python
from keepersdk.authentication import device_management

device_identifiers = ['1']  # デバイスID、または完全なデバイス名
names = device_management.logout_user_devices(auth, device_identifiers)
for name in names:
    print(f"Device '{name}' successfully logged out")
```

</details>

### デバイス削除 <a href="#device-remove-command" id="device-remove-command"></a>

1台以上のデバイスからユーザーをログアウトさせ、削除します。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `device-action remove`

**パラメータ:**

* devices 1つ以上のデバイスの行ID、完全なデバイストークン、デバイストークンの先頭部分、またはデバイス名 (完全一致)

**例:**

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

</details>

<details>

<summary>DotNet SDK</summary>

**関数:** `ExecuteDeviceAction`

```csharp
var devices = (await auth.GetUserDevices()).ToArray();
var device = devices.First(x => x.DeviceName == "Home Desktop");

var results = await auth.ExecuteDeviceAction(
    DeviceActionType.DaRemove,
    new[] { device.EncryptedDeviceToken });
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Invoke-KeeperDeviceAction`

**エイリアス:** `device-action`

**パラメータ:**

* `-Action` `remove`
* `-Devices` 1つ以上のデバイス識別子
* `-WhatIf` 操作を適用せず、内容のみを確認します
* `-Confirm` 操作を適用する前に確認を求めます

**例:**

```powershell
PS> device-action remove "Home Desktop"
PS> Invoke-KeeperDeviceAction -Action remove -Devices 1 -Confirm
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `device-action remove`

**パラメータ:**

* `devices` デバイスID (1、2、3など) またはデバイス名

**例:**

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

</details>

<details>

<summary>Python SDK</summary>

**関数:** `remove_user_devices`

**パラメータ:**

* `auth` ログイン済みの `KeeperAuth` セッション
* `device_identifiers` 1件以上のデバイスID、または完全なデバイス名

**例:**

```python
from keepersdk.authentication import device_management

device_identifiers = ['2', 'Work Laptop']  # 1件以上のデバイス
names = device_management.remove_user_devices(auth, device_identifiers)
for name in names:
    print(f"Device '{name}' successfully removed")
```

</details>

### デバイスロック <a href="#device-lock-command" id="device-lock-command"></a>

1台以上のデバイスを全ユーザーに対してロックし、ログアウトさせます。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `device-action lock`

**パラメータ:**

* devices 1つ以上のデバイスの行ID、完全なデバイストークン、デバイストークンの先頭部分、またはデバイス名 (完全一致)

**例:**

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

</details>

<details>

<summary>DotNet SDK</summary>

**関数:** `ExecuteDeviceAction`

**例:**

```csharp
var devices = (await auth.GetUserDevices()).ToArray();
var device = devices.First(x => x.DeviceName == "Work Laptop");

var results = await auth.ExecuteDeviceAction(
    DeviceActionType.DaLock,
    new[] { device.EncryptedDeviceToken });
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Invoke-KeeperDeviceAction`

**エイリアス:** `device-action`

**パラメータ:**

* `-Action` `lock`
* `-Devices` 1つ以上のデバイス識別子
* `-WhatIf` 操作を適用せず、内容のみを確認します
* `-Confirm` 操作を適用する前に確認を求めます

**例:**

```powershell
PS> device-action lock "Work Laptop"
PS> Invoke-KeeperDeviceAction -Action lock -Devices 1 -Confirm
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `device-action lock`

**パラメータ:**

* `devices` デバイスID (1、2、3など) またはデバイス名

**例:**

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

</details>

<details>

<summary>Python SDK</summary>

**関数:** `lock_user_devices`

**パラメータ:**

* `auth` ログイン済みの `KeeperAuth` セッション
* `device_identifiers` 1件以上のデバイスID、または完全なデバイス名

**例:**

```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>

### デバイスロック解除 <a href="#device-unlock-command" id="device-unlock-command"></a>

現在のユーザーについて、1台以上のデバイスとそのリンク先デバイスのロックを解除します。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `device-action unlock`

**パラメータ:**

* devices 1つ以上のデバイスの行ID、完全なデバイストークン、デバイストークンの先頭部分、またはデバイス名 (完全一致)

**例:**

```csharp
My Vault> device-action unlock 1 2
Device 'Work Laptop' successfully unlocked
Device 'Home Desktop' successfully unlocked
```

</details>

<details>

<summary>DotNet SDK</summary>

**関数:** `ExecuteDeviceAction`

**パラメータ:**

* `auth` ログイン済みの `IAuthentication` セッション
* `actionType` `DeviceActionType.DaUnlock`
* `encryptedDeviceTokens` 選択した1つ以上のデバイストークン

**例:**

```
var devices = (await auth.GetUserDevices()).ToArray();

var results = await auth.ExecuteDeviceAction(
    DeviceActionType.DaUnlock,
    new[]
    {
        devices[0].EncryptedDeviceToken,
        devices[1].EncryptedDeviceToken,
    });
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Invoke-KeeperDeviceAction`

**エイリアス:** `device-action`

**パラメータ:**

* `-Action` `unlock`
* `-Devices` 1つ以上のデバイス識別子
* `-WhatIf` 操作を適用せず、内容のみを確認します
* `-Confirm` 操作を適用する前に確認を求めます

**例:**

```powershell
PS> device-action unlock 1,2
PS> Invoke-KeeperDeviceAction -Action unlock -Devices 1,2 -Confirm
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `device-action unlock`

**パラメータ:**

* `devices` デバイスID (1、2、3など) またはデバイス名

**例:**

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

</details>

<details>

<summary>Python SDK</summary>

**関数:** `unlock_user_devices`

**パラメータ:**

* `auth` ログイン済みの `KeeperAuth` セッション
* `device_identifiers` 1件以上のデバイスID、または完全なデバイス名

**例:**

```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>

### デバイスアカウントロック <a href="#device-account-lock-command" id="device-account-lock-command"></a>

現在のユーザーに限り、1台以上のデバイスをロックします。ユーザーがログイン中の場合はログアウトされます。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `device-action account-lock`

**パラメータ:**

* devices 1つ以上のデバイスの行ID、完全なデバイストークン、デバイストークンの先頭部分、またはデバイス名 (完全一致)

**例:**

```csharp
My Vault> device-action account-lock "Work Laptop"
Device 'Work Laptop' successfully account locked
```

</details>

<details>

<summary>DotNet SDK</summary>

**関数:** `ExecuteDeviceAction`

**例:**

```csharp
var devices = (await auth.GetUserDevices()).ToArray();
var device = devices.First(x => x.DeviceName == "Work Laptop");

var results = await auth.ExecuteDeviceAction(
    DeviceActionType.DaDeviceAccountLock,
    new[] { device.EncryptedDeviceToken });
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Invoke-KeeperDeviceAction`

**エイリアス:** `device-action`

**パラメータ:**

* `-Action` `account-lock`
* `-Devices` 1つ以上のデバイス識別子
* `-WhatIf` 操作を適用せず、内容のみを確認します
* `-Confirm` 操作を適用する前に確認を求めます

**例:**

```
PS> device-action account-lock "Work Laptop"
PS> Invoke-KeeperDeviceAction -Action account-lock -Devices 1 -Confirm
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `device-action account-lock`

**パラメータ:**

* `devices` デバイスID (1、2、3など) またはデバイス名

**例:**

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

</details>

<details>

<summary>Python SDK</summary>

**関数:** `account_lock_user_devices`

**パラメータ:**

* `auth` ログイン済みの `KeeperAuth` セッション
* `device_identifiers` 1件以上のデバイスID、または完全なデバイス名

**例:**

```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>

### デバイスアカウントロック解除 <a href="#device-account-unlock-command" id="device-account-unlock-command"></a>

現在のユーザーについて、1台以上のデバイスのロックを解除します。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `device-action account-unlock`

**パラメータ:**

* devices 1つ以上のデバイスの行ID、完全なデバイストークン、デバイストークンの先頭部分、またはデバイス名 (完全一致)

**例:**

```csharp
My Vault> device-action account-unlock 1
Device 'Work Laptop' successfully account unlocked
```

</details>

<details>

<summary>DotNet SDK</summary>

**関数:** `ExecuteDeviceAction`

**例:**

```csharp
var devices = (await auth.GetUserDevices()).ToArray();
var device = devices.First(x => x.DeviceName == "Work Laptop");

var results = await auth.ExecuteDeviceAction(
    DeviceActionType.DaDeviceAccountUnlock,
    new[] { device.EncryptedDeviceToken });
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Invoke-KeeperDeviceAction`

**エイリアス:** `device-action`

**パラメータ:**

* `-Action` `account-unlock`
* `-Devices` 1つ以上のデバイス識別子
* `-WhatIf` 操作を適用せず、内容のみを確認します
* `-Confirm` 操作を適用する前に確認を求めます

**例:**

```powershell
PS> device-action account-unlock 1
PS> Invoke-KeeperDeviceAction -Action account-unlock -Devices 1 -Confirm
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `device-action account-unlock`

**パラメータ:**

* `devices` デバイスID (1、2、3など) またはデバイス名

**例:**

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

</details>

<details>

<summary>Python SDK</summary>

**関数:** `account_unlock_user_devices`

**パラメータ:**

* `auth` ログイン済みの `KeeperAuth` セッション
* `device_identifiers` 1件以上のデバイスID、または完全なデバイス名

**例:**

```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>

### デバイスリンク <a href="#device-link-command" id="device-link-command"></a>

2台以上のデバイスを互いにリンクします。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `device-action link`

**パラメータ:**

* devices 1つ以上のデバイスの行ID、完全なデバイストークン、デバイストークンの先頭部分、またはデバイス名 (完全一致)

**例:**

```csharp
My Vault> device-action link 1 2
Device 'Work Laptop' successfully linked
Device 'Home Desktop' successfully linked
```

</details>

<details>

<summary>DotNet SDK</summary>

**関数:** `ExecuteDeviceAction`

```csharp
var devices = (await auth.GetUserDevices()).ToArray();

var results = await auth.ExecuteDeviceAction(
    DeviceActionType.DaLink,
    new[]
    {
        devices[0].EncryptedDeviceToken,
        devices[1].EncryptedDeviceToken,
    });
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Invoke-KeeperDeviceAction`

**エイリアス:** `device-action`

**パラメータ:**

* `-Action` `link`
* `-Devices` 2つ以上のデバイス識別子
* `-WhatIf` 操作を適用せず、内容のみを確認します
* `-Confirm` 操作を適用する前に確認を求めます

**例:**

```powershell
PS> device-action link 1,2
PS> Invoke-KeeperDeviceAction -Action link -Devices 1,2 -Confirm
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `device-action link`

**パラメータ:**

* `devices` 2件以上のデバイスID、または完全なデバイス名

**例:**

```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" %}
永続ログインが有効な場合、リンクされたデバイスはログイン・ログアウトの動作を共有します。
{% endhint %}

</details>

<details>

<summary>Python SDK</summary>

**関数:** `link_user_devices`

**パラメータ:**

* `auth` ログイン済みの `KeeperAuth` セッション
* `device_identifiers` 2件以上のデバイスID、または完全なデバイス名

**例:**

```python
from keepersdk.authentication import device_management

# 2件以上のデバイスが必要です
device_identifiers = ['1', '2']
names = device_management.link_user_devices(auth, device_identifiers)
for name in names:
    print(f"Device '{name}' successfully linked")
```

</details>

### デバイスリンク解除 <a href="#device-unlink-command" id="device-unlink-command"></a>

以前リンクされた2台以上のデバイスのリンクを解除します。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `device-action unlink`

**パラメータ:**

* devices 1つ以上のデバイスの行ID、完全なデバイストークン、デバイストークンの先頭部分、またはデバイス名 (完全一致)

**例:**

```csharp
My Vault> device-action unlink 1 2
Device 'Work Laptop' successfully unlinked
Device 'Home Desktop' successfully unlinked
```

</details>

<details>

<summary>DotNet SDK</summary>

**関数:** `ExecuteDeviceAction`

```csharp
var devices = (await auth.GetUserDevices()).ToArray();

var results = await auth.ExecuteDeviceAction(
    DeviceActionType.DaUnlink,
    new[]
    {
        devices[0].EncryptedDeviceToken,
        devices[1].EncryptedDeviceToken,
    });
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンドレット:** `Invoke-KeeperDeviceAction`

**エイリアス:** `device-action`

**パラメータ:**

* `-Action` `unlink`
* `-Devices` 2つ以上のデバイス識別子
* `-WhatIf` 操作を適用せず、内容のみを確認します
* `-Confirm` 操作を適用する前に確認を求めます

**例:**

```powershell
PS> device-action unlink 1,2
PS> Invoke-KeeperDeviceAction -Action unlink -Devices 1,2 -Confirm
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `device-action unlink`

**パラメータ:**

* `action` `unlink` を指定する必要があります
* `devices` リンクを解除する1件以上のデバイス。最低2件のデバイスが必要です。各デバイスは、`device-list` のデバイスID、または完全なデバイス名で指定できます。大文字/小文字は区別されません。`01` のような数字のみの値は、名前ではなくリストIDとして扱われます。

**オプション:**

* `--help`, `-h` unlinkアクションのヘルプを表示します。使用方法: `device-action unlink --help`

**例:**

```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>

**関数:** `unlink_user_devices`

**パラメータ:**

* `auth` ログイン済みの `KeeperAuth` セッション
* `device_identifiers` 2件以上のデバイスID、または完全なデバイス名

**例:**

```python
from keepersdk.authentication import device_management

# 2件以上のデバイスが必要です
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/jp/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.
