# This Deviceコマンド

### 概要

現在ログインしているデバイスに関連して実行できる Keeper の機能について説明します。これらの機能の一部を有効にすると、次回ログイン以降のログイン手順の簡素化や、その他の便利な動作に役立ちます。

次のコマンドが利用できます。

* デバイス情報コマンド
* デバイス登録コマンド
* デバイスの常時ログインコマンド
* デバイスログアウトタイマー設定コマンド
* デバイス名変更コマンド
* デバイスIP自動承認コマンド
* デバイスとYubiKeyの関連コマンド

### デバイス情報コマンド

現在のデバイスの情報を表示し、ログイン支援用のデバイス制御の設定に使います。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `this-device`

**例:**

```
My Vault> this-device

         Device Name: PowerShell Commander
      Client Version: Commander 17.0.0
    Data Key Present: True
     IP Auto Approve: True
    Persistent Login: False
      Logout Timeout: 1 hour(s)
     Biometric Login: False

Available sub-commands: rename, register, persistent_login, ip_disable_auto_approve, timeout, bio
```

</details>

<details>

<summary>DotNet SDK</summary>

利用不可

</details>

<details>

<summary>PowerCommander</summary>

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

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

**構文:**

```powershell
Get-KeeperDeviceSettings [<CommonParameters>]
```

**例:**

```powershell
PS> Get-KeeperDeviceSettings

DeviceName          : PowerShell Commander
PersistentLogin     : False
DataKeyPresent      : True
IpAutoApprove       : True
IsSsoUser           : False
DeviceLogoutTimeout : 60 minute(s)
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `this-device`

**例:**

```sh
My Vault> this-device
          Device Name  Python Keeper API
     Data Key Present  False
      IP Auto Approve  True
     Persistent Login  False
Device Logout Timeout  30 days
          Is SSO User  False
```

</details>

<details>

<summary>Python SDK</summary>

**関数:** `load_account_summary`

```python
keeper_auth.load_account_summary(auth_context)
```

</details>

### デバイス登録コマンド

永続的なログインセッションに利用するため、ユーザーのデータキーをデバイスの公開鍵で暗号化します。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `this-device register`

**例:**

```
My Vault> this-device register
Device already registered.
```

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド:** `RegisterDataKeyForDevice`

```csharp
public static async Task RegisterDataKeyForDevice(this IAuthentication auth, DeviceInfo device)
```

**例:**

```csharp
// device が DeviceInfo オブジェクトであると仮定
if (!device.EncryptedDataKeyPresent)
{
    await _auth.RegisterDataKeyForDevice(device);
}
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Set-KeeperDeviceSettings`

**パラメーター:**

* `-Register` - 登録する

**構文:**

```powershell
Set-KeeperDeviceSettings -Register
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `this-device register`

**フラグ:** なし

**例:**

```sh
My Vault> this-device register
Successfully registered device
```

</details>

<details>

<summary>Python SDK</summary>

**関数:** `register_data_key_for_device`

```python
keeper_auth.register_data_key_for_device(auth_context)
```

</details>

### デバイスの常時ログインコマンド

アカウントの「ログイン状態を保持する」設定のオン/オフに使います。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `this-device persistent_login`

**例:**

```bash
My Vault> this-device persistent_login ON

My Vault> this-device persistent_login OFF
```

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド:** `SetSessionParameter`

```csharp
public static async Task SetSessionParameter(this IAuthentication auth, string name, string value)
```

**例:**

```csharp
await _auth.SetSessionParameter("this-device", "1");
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Set-KeeperDeviceSettings`

**パラメーター:**

* `-PersistentLogin` - 常時ログインの有効/無効

**例:**

```powershell
Set-KeeperDeviceSettings -PersistentLogin $true
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `this-device persistent-login`

**フラグ:** なし

**例:**

```sh
My Vault> this-device persistent-login on
Successfully ENABLED Persistent Login on this account
```

</details>

<details>

<summary>Python SDK</summary>

**関数:** `set_user_setting`

```python
keeper_auth.set_user_setting(auth_context, 'persistent_login', '1')
```

</details>

### デバイスログアウトタイマー設定コマンド

無操作のまま自動ログアウトするまでの時間を設定します。既定の単位は分です (末尾に `h` または `d` を付けて時間または日にできます)。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `this-device timeout`

**例:**

```bash
My Vault> this-device timeout 200 
```

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド:** `SetSessionParameter`

```csharp
public static async Task SetSessionParameter(this IAuthentication auth, string name, string value)
```

**例:**

```
await _auth.SetSessionInactivityTimeout(200);
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Set-KeeperDeviceSettings`

**パラメーター:**

* `-Timeout` - セッションタイムアウト (分)

**例:**

```powershell
Set-KeeperDeviceSettings -Timeout 30
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `this-device timeout`

**フラグ:** なし

**例:**

```sh
My Vault> this-device timeout 30d
Successfully set "logout_timer" to 30 days.
```

</details>

<details>

<summary>Python SDK</summary>

**関数:** `set_user_setting`

```
keeper_auth.set_user_setting(auth_context, 'logout_timer', str(timeout_in_minutes))
```

</details>

### デバイス名変更コマンド

デバイス名を変更します。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `this-device rename <NewNameHere>`

**例:**

```bash
My Vault> this-device

         Device Name: MacKeeper
      Client Version: Commander 17.0.0
    Data Key Present: True
     IP Auto Approve: True
    Persistent Login: False
      Logout Timeout: 3.3333333333333335 hour(s)
     Biometric Login: False

Available sub-commands: rename, register, persistent_login, ip_disable_auto_approve, timeout, bio

My Vault> this-device rename NewMacKeeper

My Vault> this-device

         Device Name: NewMacKeeper
      Client Version: Commander 17.0.0
    Data Key Present: True
     IP Auto Approve: True
    Persistent Login: False
      Logout Timeout: 3.3333333333333335 hour(s)
     Biometric Login: False

Available sub-commands: rename, register, persistent_login, ip_disable_auto_approve, timeout, bio
```

</details>

<details>

<summary>DotNet SDK</summary>

**コマンド:** 該当なし

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Set-KeeperDeviceSettings -NewName <SomeNewName>`

**例:**

```powershell
PS> Get-KeeperDeviceSettings                     

DeviceName          : NewMacKeeper
PersistentLogin     : False
DataKeyPresent      : True
IpAutoApprove       : True
IsSsoUser           : False
DeviceLogoutTimeout : 3 hour(s)

PS> Set-KeeperDeviceSettings -NewName MacKeeper
PS> Get-KeeperDeviceSettings                        

DeviceName          : MacKeeper
PersistentLogin     : False
DataKeyPresent      : True
IpAutoApprove       : True
IsSsoUser           : False
DeviceLogoutTimeout : 3 hour(s)
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `this-device rename`

**フラグ:** なし

```shell
My Vault> this-device rename "New Device Name"
Successfully renamed device to New Device Name
```

</details>

<details>

<summary>Python SDK</summary>

**関数:** `rename_device`

```
keeper_auth.rename_device(auth_context, 'New Device Name')
```

</details>

### デバイスIP自動承認コマンド

アカウントにおける IP アドレスのデバイス自動承認のセキュリティ設定を制御します。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `this-device ip_disable_auto_approve`

**例:**

```
My Vault> this-device ip_disable_auto_approve ON
```

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド:** `SetSessionParameter`

```csharp
public static async Task SetSessionParameter(this IAuthentication auth, string name, string value)
```

**例:**

```csharp
await _auth.SetSessionParameter("ip_disable_auto_approve", "1");
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Set-KeeperDeviceSettings -IpAutoApprove OFF`

**例:**

```powershell
PS> Set-KeeperDeviceSettings -IpAutoApprove OFF
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `this-device ip-auto-approve`

**フラグ:** なし

**例:**

```sh
My Vault> this-device ip-auto-approve on
Successfully ENABLED `ip_auto_approve`
```

</details>

<details>

<summary>Python SDK</summary>

**関数:** `set_user_setting`

```python
keeper_auth.set_user_setting(auth_context, 'ip_disable_auto_approve', '0')
# '0' で自動承認を有効、'1' で無効
```

</details>

### デバイスとYubiKeyの関連コマンド

セキュリティキー (WebAuthn) デバイスでの PIN の利用をオンまたはオフにします。

<details>

<summary>DotNet CLI</summary>

**コマンド:** 未対応

</details>

<details>

<summary>DotNet SDK</summary>

**コマンド:** 未対応

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** 未対応

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `this-device no-yubikey-pin`

**フラグ:** なし

**例:**

```sh
My Vault> this-device no-yubikey-pin on
Successfully DISABLED Security Key PIN verification
```

</details>

<details>

<summary>Python SDK</summary>

**関数:** `set_user_setting`

```python
keeper_auth.set_user_setting(auth_context, 'security_keys_no_user_verify', '1')
```

</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/jp/commander-sdk/keeper-commander-sdks/sdk-command-reference/miscellaneous-commands/this-device-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.
