# エンタープライズユーザーコマンド

#### 操作

* ユーザーの追加、編集、参照、削除などの操作
* ロック、アンロック、延長、期限切れなどのアクション
* ユーザーエイリアスとノードの設定

#### 使い方

```bash
enterprise-user --command [--options] OR eu command [--options]
```

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

#### コマンド一覧 <a href="#commands-4" id="commands-4"></a>

<table><thead><tr><th width="179.67578125">コマンド</th><th>説明</th></tr></thead><tbody><tr><td><a href="#enterprise-user-view"><code>view</code></a></td><td>エンタープライズユーザーを参照する</td></tr><tr><td><a href="#enterprise-user-add"><code>add</code></a></td><td>エンタープライズユーザーを作成する</td></tr><tr><td><a href="#enterprise-user-edit"><code>edit</code></a></td><td>エンタープライズユーザーを編集する</td></tr><tr><td><a href="#enterprise-user-delete"><code>delete</code></a></td><td>エンタープライズユーザーを削除する</td></tr><tr><td><a href="#enterprise-user-action"><code>action</code></a></td><td>エンタープライズユーザーに対するアクション</td></tr><tr><td><a href="#enterprise-user-alias"><code>alias</code></a></td><td>ユーザーエイリアスを管理する</td></tr></tbody></table>

### エンタープライズユーザーの参照 <a href="#enterprise-user-view" id="enterprise-user-view"></a>

エンタープライズユーザーの詳細を参照できます。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `enterprise-user view`

**パラメーター:** `--team` メールアドレスまたはUID

**エイリアス:** `eu vie`

**例:**

```bash
My Vault> eu view john.doe@company.com

 User Email:  john.doe@company.com
  User Name:  John Doe
    User ID:  894448414228492
     Status:  Active
      Teams:  Engineering Team
              DevOps Team
       Node:  Engineering

My Vault> enterprise-user view 894448414228492

 User Email:  john.doe@company.com
  User Name:  John Doe
    User ID:  894448414228492
     Status:  Active
      Teams:  Engineering Team
              DevOps Team
       Node:  Engineering 
```

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド:**

`EnterpriseData.GetTeamsForUser`

`EnterpriseData.TryGetTeam`

`EnterpriseData.TryGetTeam`

次の関数を組み合わせると、エンタープライズ上のユーザーに関するデータを取得できます。

</details>

<details>

<summary>PowerCommander</summary>

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

**構文:**

```powershell
Get-KeeperEnterpriseUser [[-Email] <string>] [[-Filter] <string>] [<CommonParameters>]
```

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

**パラメーター:**

* `-Email` - ユーザーのメールアドレス
* `-Filter` - 検索フィルター
* `-Format` - 出力形式
* `-Output` - 出力先ファイル名

**例:**

```powershell
PS> Get-KeeperEnterpriseUser
OR
# すべてのユーザーを一覧
PS> keu
# 特定のユーザーを取得
PS>Get-KeeperEnterpriseUser -Email "user@example.com"

# ユーザーを検索
PS> Get-KeeperEnterpriseUser -Filter "admin"
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `enterprise-user --view`

**パラメーター:**

`email` - ユーザーのメールアドレス。繰り返し指定可 (必須)

**フラグ:**

* `-v`, `--verbose` - 詳細情報を出力する
* `-h, --help` - このヘルプを表示して終了
* `--format` - 出力形式: `{table,json}`
* `--output` - 出力先ファイルのパス (形式が "table" のときは無視)

**例:**

```
My vault> enterprise-user --view <User email or UID> --output <file-path> --format json
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

```python
username = 'youremail@comapny.com'
enterprise_data = enterprise_types.IEnterpriseData
user = [user for user in enterprise_data.users.get_all_entities() if user.username.lower() == user_name.lower()]
```

</details>

### エンタープライズユーザーの追加 <a href="#enterprise-user-add" id="enterprise-user-add"></a>

エンタープライズユーザーを作成します。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `enterprise-user invite`

**エイリアス:** `eu invite`

**パラメーター:**

| パラメーター  | 説明               |
| ------- | ---------------- |
| `email` | 追加するユーザーのメールアドレス |

**例:**

```
My Vault> enterprise-user invite <email>
User test@example.com invited.

My Vault> eu invite <email>
User test@example.com invited.
```

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド:** `InviteUser(string email, [InviteUserOptions options = null])`

```csharp
Task<KeeperSecurity.Enterprise.EnterpriseUser> EnterpriseData.InviteUser(string email, [InviteUserOptions options = null])
```

**引数:**

| 引数        | 型                 | 必須  | 説明                 |
| --------- | ----------------- | --- | ------------------ |
| `email`   | string            | はい  | 招待するユーザーのメールアドレス   |
| `options` | InviteUserOptions | いいえ | 招待オプション (既定: null) |

**戻り値:**

`Task<EnterpriseUser>` - 作成された EnterpriseUser を返すタスク

**InviteUserOptions のプロパティ:**

| プロパティ      | 型           | 説明                |
| ---------- | ----------- | ----------------- |
| `FullName` | string      | ユーザーの氏名           |
| `NodeId`   | long        | ユーザーを割り当てるノードID   |
| `TeamIds`  | IEnumerable | ユーザーを追加するチームIDの一覧 |

**例:**

```csharp
var newUser = await context.EnterpriseData.InviteUser("john.doe@company.com");
Console.WriteLine($"Invited user: {newUser.Email}");
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Add-KeeperEnterpriseUser`

**パラメーター:**

| パラメーター  | 説明          |
| ------- | ----------- |
| `Email` | 招待するメールアドレス |

**フラグ:**

| フラグ         | 説明                           |
| ----------- | ---------------------------- |
| `-FullName` | ユーザーの氏名                      |
| `-Node`     | ユーザーを割り当てるノード名またはID          |
| `-NodeId`   | ノードID (long)。`-Node` の代わりに指定 |
| `-Emails`   | 追加で招待するメールアドレス (一括招待用)       |

**例:**

```powershell
PS> Add-KeeperEnterpriseUser -Node "Test node" -Email "acme1@email.com"
User invited: acme1@email.com
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `enterprise-user --add`

**パラメーター:**

`email` - ユーザーのメールアドレス。繰り返し指定可 (必須)

**フラグ:**

* `-h, --help` - このヘルプを表示して終了
* `--parent` - 親ノード名またはID
* `--name` - ユーザーの氏名を設定
* `--job-title` - 役職を設定

**例:**

```
My Vault> enterprise-user --add <User email> --name <FULL_NAME> --job-title <JOB_TITLE> --add-role <ADD_ROLE>
User Add: User ID = 1234567
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

```python
from keepersdk.enterprise import batch_management, enterprise_management

batch = batch_management.BatchManagement(loader=enterprise_loader, logger=enterprise_management_logger)
users_to_add = [enterprise_management.UserEdit(
            enterprise_user_id=enterprise_loader.get_enterprise_id(), node_id=user_node_id, username=email,
            full_name=full_name, job_title=job_title)
            for email in unique_emails]
batch.modify_users(to_add=users_to_add)
batch.apply()
```

</details>

### エンタープライズユーザーの編集 <a href="#enterprise-user-edit" id="enterprise-user-edit"></a>

ロールやチームの追加・削除など、エンタープライズユーザーの詳細を編集します。

<details>

<summary>DotNet CLI</summary>

DotNet CLI はチームへの追加 (team-add) とチームからの削除 (team-remove) に対応しています。

**チームへの追加:**

**コマンド:** `enterprise-user team-add`

**エイリアス:** `eu team-add`

**パラメーター:**

| パラメーター   | 説明                   |
| -------- | -------------------- |
| `email`  | チームに追加するユーザーのメールアドレス |
| `--team` | チーム名またはUID           |

**フラグ:**

| フラグ          | 説明         |
| ------------ | ---------- |
| `--teamname` | チーム名の代替フラグ |
| `--help`     | ヘルプ画面を表示   |
| `--version`  | バージョン情報を表示 |

**例:**

```bash
My Vault> enterprise-user team-add john.doe@company.com --team "Developers"
User john.doe@company.com added to team: Developers
# OR using alias
My Vault> eu team-add john.doe@company.com --team "Developers"
User john.doe@company.com added to team: Developers
```

**チームからの削除:**

**コマンド:** `enterprise-user team-remove`

**エイリアス:** `eu team-remove`

**パラメーター:**

| パラメーター   | 説明                    |
| -------- | --------------------- |
| `email`  | チームから削除するユーザーのメールアドレス |
| `--team` | チーム名またはUID            |

**フラグ:**

| フラグ          | 説明         |
| ------------ | ---------- |
| `--teamname` | チーム名の代替フラグ |
| `--help`     | ヘルプ画面を表示   |
| `--version`  | バージョン情報を表示 |

**例:**

```bash
My Vault> enterprise-user team-remove john.doe@company.com --team "Developers"
User john.doe@company.com removed from team: Developers

# OR

My Vault> eu team-remove john.doe@company.com --team "Developers"
User john.doe@company.com removed from team: Developers
```

</details>

<details>

<summary>DotNet SDK</summary>

**`AddUsersToTeams`**

.NET SDK を用いて、アクティブなユーザーを1人以上、1つ以上のチームに追加します。ステータスが「アクティブ」のユーザーのみ対象です。招待済みやロック中など非アクティブなユーザーには `QueueUserToTeam` を使います。

**メソッド:**

```csharp
Task AddUsersToTeams(string[] emails, string[] teamUids, Action<string> warnings = null);
```

**引数:**

| 引数         | 型          | 必須  | 説明                             |
| ---------- | ---------- | --- | ------------------------------ |
| `emails`   | `string[]` | はい  | チームに追加するユーザーのメールアドレスの配列        |
| `teamUids` | `string[]` | はい  | ユーザーを追加する先のチームUIDの配列           |
| `warnings` | Action     | いいえ | 警告メッセージを受け取るコールバック (省略時は null) |

**戻り値:**

`Task` - すべてのユーザーがすべてのチームに追加されたときに完了するタスク

**例:**

```csharp
var emails = new[] { "john.doe@company.com" };
var teamUids = new[] { "ABC123XYZ456" };

await context.EnterpriseData.AddUsersToTeams(emails, teamUids);
Console.WriteLine("User added to team successfully");
```

**`QueueUserToTeam`**

非アクティブなユーザー (招待済みまたはロック中) をチーム追加キューに入れます。アカウントがアクティブになると自動的にチームに追加されます。招待未承諾やロック中のユーザー向けです。

**メソッド:**

```csharp
Task QueueUserToTeam(long enterpriseUserId, string teamUid);
```

**引数:**

| 引数                 | 型      | 必須 | 説明                         |
| ------------------ | ------ | -- | -------------------------- |
| `enterpriseUserId` | long   | はい | 非アクティブなユーザーのエンタープライズユーザーID |
| `teamUid`          | string | はい | ユーザーをキューする先のチームのUID        |

**戻り値:**

`Task` - ユーザーがチーム用キューに入ったときに完了するタスク

**例:**

```csharp
var user = context.EnterpriseData.Users
    .FirstOrDefault(u => u.Email == "newuser@company.com");

if (user != null && user.Status != "Active")
{
    await context.EnterpriseData.QueueUserToTeam(user.Id, "TEAM_UID_123");
    Console.WriteLine($"User queued for team (Status: {user.Status})");
}
```

**`RemoveUsersFromTeams`**

.NET SDK を用いて、1人以上のユーザーを1つ以上のチームから削除します。チーム所属のみを外し、ユーザーアカウントの削除や他チームへの所属には影響しません。

**メソッド:**

```csharp
Task RemoveUsersFromTeams(string[] emails, string[] teamUids, Action<string> warnings = null);
```

**引数:**

| 引数         | 型          | 必須  | 説明                             |
| ---------- | ---------- | --- | ------------------------------ |
| `emails`   | `string[]` | はい  | チームから削除するユーザーのメールアドレスの配列       |
| `teamUids` | `string[]` | はい  | ユーザーを削除する元のチームUIDの配列           |
| `warnings` | Action     | いいえ | 警告メッセージを受け取るコールバック (省略時は null) |

**戻り値:**

`Task` - すべてのユーザーがすべてのチームから削除されたときに完了するタスク

**例:**

```csharp
var emails = new[] { "john.doe@company.com" };
var teamUids = new[] { "ABC123XYZ456" };

await context.EnterpriseData.RemoveUsersFromTeams(emails, teamUids);
Console.WriteLine("User removed from team successfully");
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** 近日対応

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `enterprise-user --edit`

**パラメーター:**

`email` - ユーザーのメールアドレスまたはUID。繰り返し指定可 (必須)

**フラグ:**

* `-h, --help` - このヘルプを表示して終了
* `--parent` - 親ノード名またはUID
* `--name` - ユーザーの氏名を設定
* `--job-title` - 役職を設定
* `--add-role` - ロール名またはロールID
* `--remove-role` - ロール名またはロールID
* `--add-team` - チーム名またはチームUID
* `--remove-team` - チーム名またはチームUID
* `-hsf`, `--hide-shared-folders` - 共有フォルダを表示しない。`--add-team`
  * のみ: `{on,off}`

**例:**

```
My Vault> enterprise-user --edit <User email> --name <FULL_NAME> --job-title <JOB_TITLE> --add-role <ADD_ROLE> -hsf on
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

```python
from keepersdk.enterprise import batch_management, enterprise_management

batch = batch_management.BatchManagement(loader=context.enterprise_loader, logger=self)

user = enterprise_data.users.get_entity('user_name')
users = [user]
users_to_update = [enterprise_management.UserEdit(
                enterprise_user_id=user.enterprise_user_id, node_id=parent_node_id, full_name=full_name, job_title=job_title)
                for user in users]
batch.modify_users(to_update=users_to_update)
batch.apply()
```

</details>

### エンタープライズユーザーの削除 <a href="#enterprise-user-delete" id="enterprise-user-delete"></a>

エンタープライズからユーザーを削除します。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `enterprise-user delete <email>`

**エイリアス:** `eu delete <email>`

**パラメーター:**

`email` メールアドレス (必須)

**オプション:**

* `--yes` - 削除時の確認プロンプトを省略する

**例:**

```bash
My Vault> enterprise-user delete john.doe@company.com
# 確認を省略
eu delete user@example.com --yes 
```

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド:** `DeleteUser`

```csharp
Task DeleteUser(EnterpriseUser user);
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Remove-KeeperEnterpriseUser` または `delete-user`

**パラメーター:**

* `-User` - ユーザーのメールアドレス (必須)
* `-Force` - 確認を省略する

**例:**

```powershell
PS> Remove-KeeperEnterpriseUser -User<user email> 
OR
delete-user "user@example.com" -Force
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `enterprise-user --delete`

**パラメーター:**

`email` - ユーザーのメールアドレスまたはUID。繰り返し指定可 (必須)

**フラグ:**

* `-h, --help` - このヘルプを表示して終了
* `-f`, `--force` - 確認プロンプトを表示しない

**例:**

```
My Vault>enterprise-user --delete <User_Email OR UID> -f
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

```python
from keepersdk.enterprise import batch_management, enterprise_management

user = enterprise_data.users.get_entity('user_name')
users = [user]
batch = batch_management.BatchManagement(loader=enterprise_loader, logger=enterprise_management_logger)
users_to_delete = [enterprise_management.UserEdit(enterprise_user_id=user.enterprise_user_id) for user in users]
batch.modify_users(to_remove=users_to_delete)
batch.apply()
```

</details>

### エンタープライズユーザーのアクション <a href="#enterprise-user-action" id="enterprise-user-action"></a>

ロックやアンロックなど、エンタープライズユーザーに対するアクションを実行できます。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `enterprise-user <action> user_email`

**例:**

**ユーザーのロック:**

```sh
My Vault> enterprise-user lock john.doe@company.com OR eu lock john.doe@company.com
```

**ユーザーのアンロック:**

```shell
My Vault> enterprise-user unlock john.doe@company.com OR eu enterprise-user unlock john.doe@company.com
```

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド:** `SetUserLocked`

```csharp
Task<EnterpriseUser> SetUserLocked(EnterpriseUser user, bool locked);
```

`locked` が true ならユーザーをロックし、false ならアンロックします。

**例:**

```csharp
var user = await context.EnterpriseData.SetUserLocked(singleUser, arguments.Command == "lock");
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Lock-KeeperEnterpriseUser` または `Unlock-KeeperEnterpriseUser`

**エイリアス:** `lock-user`, `unlock-user`

**パラメーター:** `-User` - ユーザーのメールアドレス

```powershell
PS> Unlock-KeeperEnterpriseUser -User acme1@email.com
unlock-user "user@example.com"

Lock-KeeperEnterpriseUser -User "user@example.com"
lock-user "user@example.com"
```

**コマンド:** `Move-KeeperEnterpriseUser`

ユーザーを別のノードへ移動する

**エイリアス:** `transfer-user`

**構文:**

```powershell
Move-KeeperEnterpriseUser [-Email] <string> [-NodeId] <long> [<CommonParameters>]
```

**パラメーター:**

* `-Email` - ユーザーのメールアドレス (必須)
* `-NodeId` - 移動先のノードID (必須)

**例:**

```powershell
Move-KeeperEnterpriseUser -Email "user@example.com" -NodeId 12345
transfer-user "user@example.com" 12345
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `enterprise-user --action`

**パラメーター:**

`email` - ユーザーのメールアドレスまたはID (必須)

**フラグ:**

* `-h, --help` - このヘルプを表示して終了
* `--expire` - マスターパスワードを期限切れにする
* `--extend` - ボルト転送の同意を7日延長する。擬似ユーザー @all に対応
* `--lock` - ユーザーをロックする
* `--unlock` - ユーザーをアンロックする
* `--disable-2fa` - ユーザーの2要素認証を無効にする

**例:**

```
My Vault> enterprise-user --action <User_Email OR UID> --expire
```

</details>

<details>

<summary>Python SDK</summary>

**関数:**

```python
from keepersdk.enterprise import batch_management, enterprise_management

user = enterprise_data.users.get_entity('user_name')
users = [user]
batch = batch_management.BatchManagement(loader=enterprise_loader, logger=enterprise_management_logger)
if expire_password:
    batch.user_actions(to_expire_password=[user.enterprise_user_id for user in users])
elif extend_transfer:
    batch.user_actions(to_extend_transfer=[user.enterprise_user_id for user in users])
elif lock_user:
    batch.user_actions(to_lock=[user.enterprise_user_id for user in users])
elif unlock_user:
    batch.user_actions(to_unlock=[user.enterprise_user_id for user in users])
elif disable_2fa:
    batch.user_actions(to_disable_tfa=[user.enterprise_user_id for user in users])
else:
    return

batch.apply()
```

</details>

### エンタープライズユーザーのエイリアス <a href="#enterprise-user-alias" id="enterprise-user-alias"></a>

エイリアスの追加または削除により、ユーザーエイリアスを管理します。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `enterprise-user <action> username --alias="<alias>" または eu <action> username --alias="<alias>"`

**パラメーター:**

`email` - ユーザーのメールアドレスまたはID

**例:**

**エイリアスの追加:**

```sh
My Vault> eu alias-add john.doe@company.com --alias "j.doe@company.com"
```

**エイリアスの削除:**

```sh
My Vault> eu alias-remove john.doe@company.com --alias "j.doe@company.com"
```

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド:** 近日対応

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** 近日対応

</details>

<details>

<summary>Python CLI</summary>

**コマンド:** `enterprise-user alias`

**パラメーター:**

`email` - ユーザーのメールアドレスまたはID (必須)

**フラグ:**

* `--add-alias` - ユーザーエイリアスを追加する
* `--remove-alias` - ユーザーエイリアスを削除する

</details>

<details>

<summary>Python SDK</summary>

**関数:**

```python
from keepersdk.enterprise import batch_management, enterprise_management

user = enterprise_data.users.get_entity('user_name')
aliases = enterprise_data.user_aliases.get_links_by_subject(user.enterprise_user_id)
add_user = 'email_to_add_as_alias'
if user.username == add_user:
    logging.error(f'User "%s" alias already exists', add_user)
has_alias = any((True for alias in aliases if alias.username == add_user))
if has_alias:
    alias_rq = APIRequest_pb2.EnterpriseUserAliasRequest()
    alias_rq.enterpriseUserId = user.enterprise_user_id
    alias_rq.alias = add_user
    KeeperAuth.execute_auth_rest('enterprise/enterprise_user_set_primary_alias', alias_rq)
else:
    alias_request = APIRequest_pb2.EnterpriseUserAddAliasRequest()
    alias_request.enterpriseUserId = user.enterprise_user_id
    alias_request.alias = add_user
    alias_request.primary = True
    add_rs = KeeperAuth.execute_auth_rest(
        'enterprise/enterprise_user_add_alias', alias_request, response_type=APIRequest_pb2.EnterpriseUserAddAliasResponse)
```

</details>

### エンタープライズユーザーの招待の再送

非アクティブなユーザーに招待を再送するコマンド/関数です。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `enterprise-user <action> username または eu <action> username`

**パラメーター:**

`email` - ユーザーのメールアドレスまたはID

**例:**

```sh
My Vault> eu resend-invite "j.doe@company.com"
```

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

<details>

<summary>DotNet SDK</summary>

**招待の再送:**

**メソッド:** `ResendEnterpriseInvite`

**使い方:**

```csharp
 public async Task ResendEnterpriseInvite(EnterpriseUser enterpriseUser)
```

**パラメーター:**

<table><thead><tr><th width="227.4921875">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>enterpriseUser</code></td><td>ユーザーを表す EnterpriseUser オブジェクト</td></tr></tbody></table>

**例:**

{% code overflow="wrap" %}

```csharp
await EnterpriseManagementExamples.EnterpriseUserExamples.UserExamples.ResendEnterpriseInviteExample("tohela1765@icousd.com");
```

{% endcode %}

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Resend-KeeperEnterpriseInvite`

**フラグ:**

<table><thead><tr><th width="150.9345703125">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>User</code></td><td>再度招待を送る対象のユーザー</td></tr></tbody></table>

**例:**

```powershell
PS> Resend-KeeperEnterpriseInvite -User "abcwfef@email.com"      
Invite for abcwfef@email.com resent.


PS> Resend-KeeperEnterpriseInvite -User amandli@keepersecurity.com                        
Resend-KeeperEnterpriseInvite: User has already accepted invitation. Only inactive users can have invitations resent.
```

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

<details>

<summary>Python CLI</summary>

近日対応

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

<details>

<summary>Python SDK</summary>

近日対応

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

### エンタープライズユーザーのマスターパスワード期限の設定

マスターパスワードの期限を設定し、ユーザーに新しいパスワードの設定を求めるコマンド/関数です。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `enterprise-user <action> username または eu <action> username`

**パラメーター:**

`email` - ユーザーのメールアドレスまたはID

**例:**

```sh
My Vault> eu set-master-password-expire "nelelex252@hudisk.com"
```

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

<details>

<summary>DotNet SDK</summary>

**マスターパスワード期限の設定:**

**メソッド:** `SetMasterPasswordExpire`

**使い方:**

```csharp
 public async Task SetMasterPasswordExpire(string email)
```

**パラメーター:**

<table><thead><tr><th width="227.4921875">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>email</code></td><td>対象ユーザーのメールアドレス</td></tr></tbody></table>

**例:**

{% code overflow="wrap" %}

```csharp
await EnterpriseManagementExamples.EnterpriseUserExamples.UserExamples.SetMasterPasswordExpireExample("nelelex252@hudisk.com");
```

{% endcode %}

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

<details>

<summary>PowerCommander</summary>

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

**フラグ:**

<table><thead><tr><th width="150.9345703125">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>User</code></td><td>マスターパスワードを期限切れにするユーザー</td></tr></tbody></table>

**例:**

```powershell
PS> Set-KeeperEnterpriseUserMasterPasswordExpire -User tofam63308@ixospace.com                                  
Master password expiration set for tofam63308@ixospace.com
```

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

<details>

<summary>Python CLI</summary>

近日対応

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

<details>

<summary>Python SDK</summary>

近日対応

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

### エンタープライズチームのユーザー種別の更新

チーム内のユーザーの種別を更新するコマンド/関数です。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `enterprise-user <action> username --team=<team_name> --user-type=<user_type>`

**パラメーター:**

`email` - ユーザーのメールアドレスまたはID

`team` - チーム名またはID

`user-type` - 0=ユーザー、1=管理者、2=admin\_only (共有フォルダは表示されないがチームへのユーザー追加は可能)

**例:**

```sh
My Vault> eu team-user-update "nelelex252@hudisk.com" --team="T2" --user-type=0
```

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

<details>

<summary>DotNet SDK</summary>

**チーム内ユーザーの更新:**

**メソッド:** `TeamEnterpriseUserUpdate`

**使い方:**

```csharp
 public async Task TeamEnterpriseUserUpdate(EnterpriseTeam enterpriseTeam, EnterpriseUser enterpriseUser, int userType)
```

**パラメーター:**

<table><thead><tr><th width="227.4921875">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>enterpriseTeam</code></td><td>チームを表す EnterpriseTeam オブジェクト</td></tr><tr><td><code>enterpriseUser</code></td><td>ユーザーを表す EnterpriseUser オブジェクト</td></tr><tr><td><code>userType</code></td><td>0=ユーザー、1=管理者、2=admin_only (共有フォルダは表示されないがチームへのユーザー追加は可能)</td></tr></tbody></table>

**例:**

{% code overflow="wrap" %}

```csharp
await EnterpriseManagementExamples.EnterpriseUserExamples.UserExamples.TeamEnterpriseUserUpdateExample("jTiPyIP4NmPiyAVv2oKFpw", "nebilem641@nctime.com", 0);
```

{% endcode %}

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Update-KeeperEnterpriseTeamUser`

**フラグ:**

<table><thead><tr><th width="150.9345703125">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>User</code></td><td>更新対象のエンタープライズユーザー</td></tr><tr><td><code>Team</code></td><td>チーム名またはUID</td></tr><tr><td><code>UserType</code></td><td>ユーザー種別: 0、1、または 2<br>0 - ユーザー (一般)<br>1 - 管理者<br>2 - 管理者のみ</td></tr></tbody></table>

**例:**

```powershell
PS > Update-KeeperEnterpriseTeamUser -Team PCTTeam -User tofam63308@ixospace.com -UserType 1                     
Team user tofam63308@ixospace.com updated
```

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

<details>

<summary>Python CLI</summary>

近日対応

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

<details>

<summary>Python SDK</summary>

近日対応

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

### エンタープライズユーザーの情報更新

表示名や役職など、ユーザー情報を更新するコマンド/関数です。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `enterprise-user <action> username --node=<node_name> --name=<display_name> --job-title=<title> --invitee-locale=<location_name>`

**パラメーター:**

`email` - ユーザーのメールアドレスまたはID。

`node` - 新しいノード名またはID。

`name` - 新しいユーザー表示名。

`job-title` - 新しい役職。

`invitee-locale` - 新しいロケール。

**例:**

{% code overflow="wrap" %}

```sh
My Vault> eu user-update "nelelex252@hudisk.com" --node="Test" --name="T122" --job-title="T-Engineer" --invitee-locale="en-US" 
```

{% endcode %}

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

<details>

<summary>DotNet SDK</summary>

**ユーザー情報の更新:**

**メソッド:** `EnterpriseUserUpdate`

**使い方:**

{% code overflow="wrap" %}

```csharp
public async Task<EnterpriseUser> EnterpriseUserUpdate(EnterpriseUser enterpriseUser, long? nodeId = null, string fullName = null, string jobTitle = null, string inviteeLocale = null)
```

{% endcode %}

**パラメーター:**

<table><thead><tr><th width="227.4921875">パラメーター</th><th>説明</th></tr></thead><tbody><tr><td><code>enterpriseUser</code></td><td>ユーザーを表す EnterpriseUser オブジェクト</td></tr><tr><td><code>nodeId</code></td><td>ノードIDまたは名前</td></tr><tr><td>fullName</td><td>表示名</td></tr><tr><td>jobTitle</td><td>役職名</td></tr><tr><td>inviteeLocale</td><td>サポートする21ロケールのいずれか。既定は en_US</td></tr></tbody></table>

**例:**

{% code overflow="wrap" %}

```csharp
await EnterpriseManagementExamples.EnterpriseUserExamples.UserExamples.EnterpriseUserUpdateExample("nebilem641@nctime.com", 70411693850884, "TestUser1", "Test Engineer", "en-US");
```

{% endcode %}

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Update-KeeperEnterpriseUser`

**フラグ:**

<table><thead><tr><th width="150.9345703125">パラメーター</th><th width="189.5146484375">必須</th><th>説明</th></tr></thead><tbody><tr><td><code>User</code></td><td>はい</td><td>更新対象のエンタープライズユーザー</td></tr><tr><td><code>Node</code></td><td>いいえ</td><td>ノード名またはID</td></tr><tr><td><code>FullName</code></td><td>いいえ</td><td>ユーザーの氏名</td></tr><tr><td><code>JobTitle</code></td><td>いいえ</td><td>ユーザーの役職</td></tr><tr><td><code>InviteeLocale</code></td><td>いいえ</td><td>招待に用いるロケール</td></tr></tbody></table>

**例:**

```powershell
PS> Update-KeeperEnterpriseUser -User tofam63308@ixospace.com -Node PCTNode -FullName "some new name" -JobTitle "ÄBC" -InviteeLocale US
User tofam63308@ixospace.com updated

Id             DisplayName   Email                   UserStatus NodeName TransferStatus 2FA
--             -----------   -----                   ---------- -------- -------------- ---
70411693853031 some new name tofam63308@ixospace.com Active     PCTNode       Yes       No
```

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

<details>

<summary>Python CLI</summary>

近日対応

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</details>

<details>

<summary>Python SDK</summary>

近日対応

**参照:**

[コマンダーリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#changing-role-enforcements-and-privileges)

</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/enterprise-management-commands/enterprise-user-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.
