# シークレットマネージャーアプリケーションコマンド

### シークレットマネージャーアプリ操作コマンド

このサブセットのシークレットマネージャーコマンドは、ボルト内の **\[シークレットマネージャー]** > **\[マイアプリケーション]** にあるKeeperシークレットマネージャーアプリケーションを扱います。アプリケーションのCRUDおよび共有/共有解除を行えるため、シークレットやフォルダなどのボルトデータにアプリ経由でアクセスできます。

**コマンド**:

* [アプリ一覧取得コマンド](#secrets-manager-app-list)
* [アプリ作成コマンド](#secrets-manager-app-create)
* [アプリ参照コマンド](#secrets-manager-app-view)
* [アプリ削除コマンド](#secrets-manager-app-delete)
* [アプリ共有コマンド](#secrets-manager-app-share)
* [アプリ共有解除コマンド](#secrets-manager-app-unshare)

### アプリ一覧取得コマンド

この操作は、Keeperボルトで利用できるKeeperシークレットマネージャーアプリケーションをすべて表形式で取得して表示します。各行にはアプリケーション固有のUIDとタイトルが含まれます。アクセスやクライアントを管理する前に登録済みアプリをすばやく確認するのに便利です。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `ksm list`

**フラグ:**

* `--folder` : 共有フォルダのUIDまたは名前。「share」「unshare」のみ
* `-e, --can-edit` : シークレットを編集できるか。「share」「unshare」のみ
* `--client-name` : クライアント名。「add-client」「remove-client」のみ
* `--unlock-ip` : IPアドレスのロックを解除するか。「add-client」のみ
* `--create-expire` : デバイス作成の有効期限（分）。「add-client」のみ
* `--access-expire` : デバイスアクセスの有効期限（分）。「add-client」のみ
* `--b64` : ワンタイムトークンの代わりにKSM構成を返す。「add-client」のみ
* `--email` : ユーザーのUIDまたはメールアドレス。「app-share」「app-unshare」のみ
* `--is-admin` : 管理者ユーザーとして共有する。「app-share」「app-unshare」のみ
* `--help` : このヘルプ画面を表示します。
* `--version` : バージョン情報を表示します。
* `value pos. 0` : KSMコマンドの候補: "`view`", "`create`", "`delete`", "`share`", "`unshare`", "`add-client`", "`delete-client`", "`list`", "`app-share`", "`app-unshare`"
* `value pos. 1` : シークレットマネージャーアプリケーションのUIDまたはタイトル

**例:**

```
My Vault> ksm list

  #  Application UID         Title          
---  ----------------------  ---------------
  1  ksm_app_uid             DemoApplication
```

</details>

<details>

<summary>DotNet SDK</summary>

ボルトが事前に認証済みであれば、次のコードでSDKからアプリケーション一覧を取得できます。

```csharp
foreach (var app in context.Vault.KeeperRecords.OfType<ApplicationRecord>())
{
    Console.WriteLine(app.Uid, app.Title);
}
```

</details>

<details>

<summary>PowerCommander</summary>

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

**エイリアス:** `ksm`

**フラグ**:

* `-Uid`
* `-Filter`
* `-Detail`

**例:**

```powershell
PS> Get-KeeperSecretManagerApp
ksm

# 特定のアプリを取得
Get-KeeperSecretManagerApp -Uid "AppUID"
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド**: `secrets-manager-app --command='list'`

**パラメーター**:

* `--command` : list

**例:**

```sh
My Vault> secrets-manager-app --command='list'

App Name     App UID                 Records   Folders  Devices  Last Access     
---------    ----------------------  --------  -------  -------  ---------
My App       ksm_app_uid             10         2       40       2025-01-01
```

</details>

<details>

<summary>Python SDK</summary>

**関数:** `list_secrets_manager_apps`

```python
from keepersdk.vault import ksm_management

app_list = ksm_management.list_secrets_manager_apps(vault=vault)
for app in app_list:
    print(app.name)
    print(app.uid)
    print(app.records)
    print(app.folders)
    print(app.count)
    print(app.last_access)
    print(app.client_devices)
    print(app.shared_secrets)
```

</details>

### アプリ作成コマンド

`create` アクションは、Keeperボルトに新しいKeeperシークレットマネージャーアプリケーションレコードを作成します。このアプリケーションには、後からクライアントデバイスや共有フォルダを設定し、シークレット管理や自動化の用途に使えます。作成時にアプリケーション名（`KsmId`）を指定することもできます。

作成後、出力にアプリケーションのUIDとタイトルが表示されます。

<details>

<summary>DotNet CLI</summary>

**コマンド**: `ksm create <APP_NAME>`

**フラグ:**

* `--folder` : 共有フォルダのUIDまたは名前。「share」「unshare」のみ
* `-e, --can-edit` : シークレットを編集できるか。「share」「unshare」のみ
* `--client-name` : クライアント名。「add-client」「remove-client」のみ
* `--unlock-ip` : IPアドレスのロックを解除するか。「add-client」のみ
* `--create-expire` : デバイス作成の有効期限（分）。「add-client」のみ
* `--access-expire` : デバイスアクセスの有効期限（分）。「add-client」のみ
* `--b64` : ワンタイムトークンの代わりにKSM構成を返す。「add-client」のみ
* `--email` : ユーザーのUIDまたはメールアドレス。「app-share」「app-unshare」のみ
* `--is-admin` : 管理者ユーザーとして共有する。「app-share」「app-unshare」のみ
* `--help` : このヘルプ画面を表示します。
* `--version` : バージョン情報を表示します。
* `value pos. 0` : KSMコマンド: "`view`", "`create`", "`delete`", "`share`", "`unshare`", "`add-client`", "`delete-client`", "`list`", "`app-share`", "`app-unshare`"
* `value pos. 1` : シークレットマネージャーアプリケーションのUIDまたはタイトル

**例:**

```sh
My Vault> ksm create DemoApplicationCreateTest
     Application UID: <AppUID>
               Title: DemoApplicationCreateTest
```

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド:** `CreateSecretManagerApplication`

**例:**

```csharp
var ApplicationRecord = await context.Vault.CreateSecretManagerApplication(ApplicationName);
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Add-KeeperSecretManagerApp <appName>`

**フラグ**:

* `-AppName`

**例:**

```powershell
PS> Add-KeeperSecretManagerApp DemoPowerShellCreateApp

UID                    Type Title                   Info
---                    ---- -----                   ----
ksm_app_uid            app  DemoPowerShellCreateApp 
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `secrets-manager-app --command='create' or 'add'`

**パラメーター:**

* `--command` {list,get,add,create,remove,share,unshare}\
  次のいずれか: list, get, add, create, remove, share, unshare
* `--app, -a` : 作成するシークレットマネージャーアプリの名前を指定します

**オプション**:

* `--force, -f` : 同名のシークレットマネージャーアプリを強制的に追加します

**例:**

```sh
My Vault> secrets-manager-app --command='create' --app='My App'
Application successfully created (UID: 0xXXxxX0x_xx0x0xXxXxXX)
```

</details>

<details>

<summary>Python SDK</summary>

**関数:** `create_secrets_manager_app`

```python
from keepersdk.vault import ksm_management

ksm_management.create_secrets_manager_app(vault=vault, name='App Name', force_add=True)
```

</details>

### アプリ参照コマンド

UIDまたは名前を指定して、特定のKeeperシークレットマネージャーアプリケーションの詳細を表示します。

このコマンドはボルトからアプリケーションレコードを取得し、UID、タイトル、共有状態、リンクされた共有フォルダ、関連レコードなどのメタデータを出力します。

**動作:**

* 指定した名前を使ってボルトからKeeperシークレットマネージャーアプリケーションを取得します。
* Keeperに保存されている内容に近い形で、アプリケーションの詳細の要約を出力します。
* 監査や、構成およびアクセス関係の確認に便利です。

<details>

<summary>DotNet CLI</summary>

**コマンド** : `ksm view <AppName>`

**フラグ :**

* `--folder` : 共有フォルダのUIDまたは名前。「share」「unshare」のみ
* `-e, --can-edit` : シークレットを編集できるか。「share」「unshare」のみ
* `--client-name` : クライアント名。「add-client」「remove-client」のみ
* `--unlock-ip` : IPアドレスのロックを解除するか。「add-client」のみ
* `--create-expire` : デバイス作成の有効期限（分）。「add-client」のみ
* `--access-expire` : デバイスアクセスの有効期限（分）。「add-client」のみ
* `--b64` : ワンタイムトークンの代わりにKSM構成を返す。「add-client」のみ
* `--email` : ユーザーのUIDまたはメールアドレス。「app-share」「app-unshare」のみ
* `--is-admin` : 管理者ユーザーとして共有する。「app-share」「app-unshare」のみ
* `--help` : このヘルプ画面を表示します。
* `--version` : バージョン情報を表示します。
* `value pos. 0` : KSMコマンド: "`view`", "`create`", "`delete`", "`share`", "`unshare`", "`add-client`", "`delete-client`", "`list`", "`app-share`", "`app-unshare`"
* `value pos. 1` : シークレットマネージャーアプリケーションのUIDまたはタイトル

**例:**

```sh
My Vault> ksm view DemoApplication       
     Application UID: ksm_app_uid
               Title: DemoApplication

Shares
  #  Share Type    Share UID               Share Title         Editable  Created          
---  ------------  ----------------------  ------------------  --------  -----------------
  1  SharedFolder  share_uid               Demo Shared Folder  -         7/23/2025 9:07 AM

Devices
  #  Name         Device ID  Created            Last Accessed
---  -----------  ---------  -----------------  -------------
  1  Device name  XX2ABC     7/23/2025 9:06 AM      
```

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド:** `TryGetKeeperRecord`

**例:**

```csharp
public bool TryGetKeeperRecord(string recordUid, out KeeperRecord application)
```

</details>

<details>

<summary>PowerCommander</summary>

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

**エイリアス :** `ksm <uid>`

**フラグ** :

* `Uid`
* `Filter`
* `Detail`

**例:**

```powershell
PS> ksm ksm_app_uid -Detail

Uid                    Title           IsExternalShare DeviceCount ShareCount
---                    -----           --------------- ----------- ----------
ksm_app_uid            DemoApplication False           1           1
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `secrets-manager-app --command='get'`

**パラメーター:**

* `--command` = get
* `--app, -a` : 取得する secrets-manager-app のUIDまたはタイトルです

**例:**

```sh
My Vault> secrets-manager-app --command='get' --app='My App'

Secrets Manager Application
App Name: My App
App UID: abcd_1234_XXXX

Client Device 1
============================
Device Name: 0XxXX00Xx0x
Short ID: ABCD1234
Created on: 2025-01-01 00:00:00
Expires On: None
First Access: None
Last Access: None
IP Lock: False
IP Address: --

Share Type        UID                Title        Permissions
---------------   ----------------   ----------   --------------
Folder            abcd1234ABCD1234   App Folder   True
```

</details>

<details>

<summary>Python SDK</summary>

**関数:** `get_secrets_manager_app`

```python
from keepersdk.vault import ksm_management


ksm_management.get_secrets_manager_app(vault: vault_online.VaultOnline, uid_or_name: str) -> ksm.SecretsManagerApp:
```

</details>

### アプリ削除コマンド

ユーザーが指定したUIDまたは名前のアプリケーションを削除します。

**動作:**

* 指定された名前またはUIDに基づきシークレットマネージャーアプリケーションを取得します
* (PowerShellでは) ユーザーに確認を求めます
* 指定したUIDのアプリケーションを削除します

<details>

<summary>DotNet CLI</summary>

**コマンド:** `ksm delete <APP_UID>`

**フラグ :**

* `--folder` : 共有フォルダのUIDまたは名前。「share」「unshare」のみ
* `-e, --can-edit` : シークレットを編集できるか。「share」「unshare」のみ
* `--client-name` : クライアント名。「add-client」「remove-client」のみ
* `--unlock-ip` : IPアドレスのロックを解除するか。「add-client」のみ
* `--create-expire` : デバイス作成の有効期限（分）。「add-client」のみ
* `--access-expire` : デバイスアクセスの有効期限（分）。「add-client」のみ
* `--b64` : ワンタイムトークンの代わりにKSM構成を返す。「add-client」のみ
* `--email` : ユーザーのUIDまたはメールアドレス。「app-share」「app-unshare」のみ
* `--is-admin` : 管理者ユーザーとして共有する。「app-share」「app-unshare」のみ
* `--help` : このヘルプ画面を表示します。
* `--version` : バージョン情報を表示します。
* `value pos. 0` : KSMコマンド: "`view`", "`create`", "`delete`", "`share`", "`unshare`", "`add-client`", "`delete-client`", "`list`", "`app-share`", "`app-unshare`"
* `value pos. 1` : シークレットマネージャーアプリケーションのUIDまたはタイトル

**例:**

```sh
My Vault> ksm delete ksm_app_uid
KSM Application DemoApplicationCreateTest has been deleted.
```

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド**: `DeleteSecretManagerApplication`

**例:**

```csharp
public async Task DeleteSecretManagerApplication(string applicationId)
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Remove-KeeperSecretManagerApp <APP_UID>`

**エイリアス**: `ksm-delete`

**例:**

```powershell
PS> ksm-delete ksm_app_uid

Confirm
Are you sure you want to perform this action?
Performing the operation "Delete" on target "Secrets Manager App UID: ksm_app_uid".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
System.Threading.Tasks.VoidTaskResult
Secrets Manager Application with UID 'ksm_app_uid' has been deleted.
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `secrets-manager-app --command='remove' --app='<app_uid_or_name>'`

**パラメーター**:

`--command` remove

**オプション**:

`--force` クライアントが紐付いているシークレットマネージャーアプリを強制削除します

**例:**

```sh
My Vault> secrets-manager-app --command='remove' --app='My App' --force
Application was successfully removed (UID: XX0XXXX000xx-XxxxXXxxX)
```

</details>

<details>

<summary>Python SDK</summary>

**関数:** `remove_secrets_manager_app`

```python
from keepersdk.vault import ksm_management
ksm_management.remove_secrets_manager_app(vault: vault_online.VaultOnline, uid_or_name: str, force: Optional[bool] = False):
```

</details>

### アプリ共有コマンド

このコマンドは、指定したユーザーとアプリケーションを共有します。ユーザーが共有可能なプールに含まれていない場合 (既定ではチーム/エンタープライズ)、指定したメールアドレスに共有招待が送られます。

**動作:**

* アプリの詳細と共有に関する情報を取得します
* ユーザーがすでに共有可能なプールにおり、アプリへのアクセスがあるかを確認します
* アプリを共有可能ならユーザーと共有し、そうでなければ招待付きのメールをユーザーに送ります

<details>

<summary>DotNet CLI</summary>

**コマンド**: `ksm app-share APP_UID --email=USER_EMAIL --is-admin --can-edit --folder=<FOLDER_UID_FOR_SHARE_FOLDER>`

**フラグ**

<table><thead><tr><th width="117.015625">フラグ</th><th width="117.04681396484375">使い方</th><th>説明</th></tr></thead><tbody><tr><td>--can-edit</td><td>--can-edit</td><td>コマンドでこのフラグを指定すると、ユーザーの編集可否が true になり、共有されたアプリケーションをユーザーが編集できます。指定しない場合は読み取り専用です。</td></tr><tr><td>--folder</td><td>--folder=UID</td><td>指定する場合は <code>--folder=FOLDER_UID</code> の形式とします。アプリケーションがアクセスできるすべてではなく、サブフォルダだけをユーザーと共有します。</td></tr><tr><td>--is-admin</td><td>--is-admin</td><td>指定すると、ユーザーにアプリケーションおよび共有されているすべてへの管理者権限が付与されます。</td></tr><tr><td>--email</td><td>--email=id</td><td><strong>必須</strong>です。<code>--email=EMAIL_ID</code> の形式で指定します。共有先ユーザーのメールアドレスです。</td></tr></tbody></table>

**例:**

```sh
My Vault> ksm app-share APP_UID --email=USER_EMAIL --is-admin --can-edit --folder=<FOLDER_UID_FOR_SHARE_FOLDER>
User <user> is not found in the list of users for sharing.
Share invitation request has been sent to user <user_email>. Please wait for the user to accept the request before sharing the application.
Application "DemoApplication" has been shared with user <USER_EMAIL>
```

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド:** `ShareRecordWithUser`

**フラグ:**

<table><thead><tr><th width="190.3958740234375">関数パラメーター</th><th width="142.015625">使い方</th><th>説明</th></tr></thead><tbody><tr><td>recordUid</td><td>&#x3C;Record UID></td><td>共有する必要があるアプリケーション/レコードのUIDです。</td></tr><tr><td>username</td><td>&#x3C;Email></td><td>アプリケーションを共有する相手ユーザーのメールまたはユーザーIDです。</td></tr><tr><td>options.CanEdit</td><td>boolean</td><td>アプリケーションのデータを編集できるかどうかです。</td></tr><tr><td>options.CanShare</td><td>boolean</td><td>アプリケーションを共有できるかどうかです。</td></tr><tr><td>userType</td><td>Enum</td><td>ユーザーの種類（エンタープライズユーザーまたは通常ユーザー）です。</td></tr></tbody></table>

**例:**

```csharp
public async Task ShareRecordWithUser(string recordUid, string username, IRecordShareOptions options)
```

```csharp
public async Task PutUserToSharedFolder(string sharedFolderUid,
            string userId,
            UserType userType,
            IUserShareOptions options)
```

**注意:**

* この方法でアプリケーションを共有するには手順に従う必要があります。
* ユーザーとアプリケーションを共有するときは、まずこのアプリケーションがアクセスできるすべてのレコードを取得します。
* すべてのレコードを取得したら、必要な権限で `ShareRecordWithUser` を用いて、該当ユーザーとレコードを1件ずつ共有します。
* アプリケーションがアクセスできる共有フォルダをすべて取得したら、`PutUserToSharedFolder` を使って各共有フォルダにユーザーを追加します。
* 上記がすべて完了したら、適切な権限で `ShareRecordWithUser` を用いて、ユーザーとアプリケーションレコード（アプリ本体）を共有します。
* 以上でアプリケーションの共有は完了です。

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Grant-KeeperAppAccess -ApplicationId <APP_UID> -UserUid <USER_ID>`

**フラグ:**

<table><thead><tr><th width="117.015625">フラグ</th><th width="123.85406494140625">使い方</th><th>説明</th></tr></thead><tbody><tr><td>-IsAdmin</td><td>-IsAdmin</td><td>指定すると、ユーザーにアプリケーションおよび共有されているすべてへの管理者権限が付与されます。</td></tr><tr><td>-UserUid</td><td>-UserUid &#x3C;id></td><td><strong>必須</strong>です。`-UserUid EMAIL_ID` の形式で指定します。共有先ユーザーのメールアドレスです。</td></tr></tbody></table>

**例:**

```powershell
PS> Grant-KeeperAppAccess -ApplicationId <APP_UID> -UserUid <USER_UID> -IsAdmin
Granting Secrets Manager application access to '<APP_UID>'...
Successfully granted access to application <APP_UID> for user '<USER_UID>'.
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド**: `secrets-manager-app --command='share'`

**フラグ**:

* `--command` = share
* `-a, --app` : 共有するアプリの名前またはUIDです
* `-e, --email` : アプリを共有/共有解除する相手ユーザーのメールアドレスです
* `--admin` : アプリ内のレコードを共有・編集する管理者権限です

**例:**

```sh
My Vault> secrets-manager-app --command='share' --email='abc@email.com' --app='My App'
Record <APP_UID> access permissions has been granted to user 'abc@email.com'
Share updates processed successfully
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

```python

    success_responses, failed_responses = ksm_management.share_secrets_manager_app(
        vault=vault,
        enterprise=enterprise_data,
        app_uid=app_uid_or_name,
        emails=user_emails,
        action="grant",
        can_edit=can_edit,
        can_share=can_share,
    )

    # Note: SDK may return (None, None) due to list.extend() in return; treat as success.
    if success_responses:
        print(f"KSM app '{app_uid_or_name}': {action} succeeded for {len(success_responses)} user(s).")
    if failed_responses:
        for r in failed_responses:
            print(f"  Failed: {r}")
    if (not success_responses or success_responses is None) and (
        not failed_responses or failed_responses is None
    ):
        print(f"KSM app '{app_uid_or_name}': {action} completed for {len(user_emails)} user(s).")

```

</details>

### アプリ共有解除コマンド

このコマンドは、指定したユーザーとのアプリケーション共有を解除します。ユーザーのアプリケーションへのアクセスに加え、アプリケーション配下のフォルダとレコードへのアクセスも取り消されます。

**動作:**

* アプリの詳細と共有に関する情報を取得します
* ユーザーがアプリへのアクセス権を持つかを確認します
* ユーザーが見つからない場合は、その旨を示してコマンドを終了します
* アプリがユーザーと共有されている場合は、アプリ内のレコードとフォルダへのアクセスを削除したうえで、アプリへのアクセスを取り消します

<details>

<summary>DotNet CLI</summary>

**コマンド**: `ksm app-unshare APP_UID --email=USER_EMAIL`

**フラグ**

<table><thead><tr><th width="117.015625">フラグ</th><th width="117.04681396484375">使い方</th><th>説明</th></tr></thead><tbody><tr><td>email</td><td>--email=id</td><td><strong>必須</strong>です。<code>--email=EMAIL_ID</code> の形式で指定します。アプリケーションに関するアクセスを取り消すユーザーです。</td></tr></tbody></table>

**例:**

```sh
My Vault> ksm app-unshare ksm_app_uid --email=<user_email>                                                  
Application "DemoApplication" has been unshared from user <user_email>
```

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド:** `RevokeShareFromUser` / `RemoveUserFromSharedFolder`

**フラグ:**

<table><thead><tr><th width="190.3958740234375">関数パラメーター</th><th width="142.015625">使い方</th><th>説明</th></tr></thead><tbody><tr><td>recordUid</td><td>&#x3C;Record UID></td><td>取り消す必要があるアプリケーション/レコードのUIDです。</td></tr><tr><td>username</td><td>&#x3C;Email></td><td>アプリケーションの共有を取り消す相手ユーザーのメールまたはユーザーIDです。</td></tr><tr><td>userType</td><td>Enum</td><td>ユーザーの種類（エンタープライズユーザーまたは通常ユーザー）です。</td></tr></tbody></table>

**例:**

```csharp
public async Task RevokeShareFromUser(string recordUid, string username)
```

```csharp
public async Task RemoveUserFromSharedFolder(string sharedFolderUid, string userId, UserType userType)
```

**注意:**

* アプリケーションへのアクセスを取り消すにはこの手順に従う必要があります
* ユーザーからアプリケーションの共有を取り消すときは、まずこのアプリケーションがアクセスできるすべてのレコードを取得します
* すべてのレコードを取得したら、必要な権限で `RevokeShareFromUser` を用いて該当ユーザーからすべて取り消します
* アプリケーションがアクセスできる共有フォルダをすべて取得したら、`RemoveUserFromSharedFolder` を使って各共有フォルダからユーザーを削除します
* 上記がすべて完了したら、`RevokeShareFromUser` を用いてユーザーからアプリケーションを取り消します
* 以上でアプリケーションの共有取り消しは完了です

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Revoke-KeeperAppAccess -ApplicationId <APP_UID> -UserUid <USER_ID>`

**フラグ:**

<table><thead><tr><th width="117.015625">フラグ</th><th width="123.85406494140625">使い方</th><th>説明</th></tr></thead><tbody><tr><td>UserUid</td><td>-UserUid &#x3C;id></td><td><strong>必須</strong>です。`-UserUid EMAIL_ID` の形式で指定します。アクセスを取り消す対象ユーザーのメールアドレスです。</td></tr></tbody></table>

**例:**

```powershell
PS> Revoke-KeeperAppAccess -ApplicationId ksm_app_uid -UserUid <user_email>
Revoking Secrets Manager application access from '<user_email>'...
Successfully revoked access to application 'ksm_app_uid' from user '<user_email>'.
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `secrets-manager-app --command='unshare'`

**パラメーター**:

`--command` = unshare

`-a` `--app` 共有解除するアプリの名前またはUIDです

`-e` `--email` アプリを共有/共有解除する相手ユーザーのメールアドレスです

**例:**

```sh
My Vault> secrets-manager-app --command='unshare' --email='abc@email.com' --app='My App'
Record <APP_UID> access permissions has been revoked from user 'abc@email.com'
Share updates processed successfully
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

```python

    success_responses, failed_responses = ksm_management.share_secrets_manager_app(
        vault=vault,
        enterprise=enterprise_data,
        app_uid=app_uid_or_name,
        emails=user_emails,
        action="remove",
        can_edit=can_edit,
        can_share=can_share,
    )

    # Note: SDK may return (None, None) due to list.extend() in return; treat as success.
    if success_responses:
        print(f"KSM app '{app_uid_or_name}': {action} succeeded for {len(success_responses)} user(s).")
    if failed_responses:
        for r in failed_responses:
            print(f"  Failed: {r}")
    if (not success_responses or success_responses is None) and (
        not failed_responses or failed_responses is None
    ):
        print(f"KSM app '{app_uid_or_name}': {action} completed for {len(user_emails)} user(s).")

```

</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/secrets-manager-commands/secrets-manager-app-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.
