# Team Commands

### Overview

The purpose of creating teams is to give users the ability to share the records and folders within their vaults with logical groupings of individuals. The administrator simply creates the teams, sets any Team Restrictions (edit/viewing/sharing of passwords) and adds individual users to the team. Users can be added to teams either manually or using several different automated methods.

Teams can also be used to easily assign Roles to entire groups of users to ensure the consistency of enforcement policies across a collective group of individuals. More details [here](https://docs.keeper.io/enterprise-guide/teams).

Commands related to teams are

1. [Enterprise Team](https://docs.keeper.io/en/keeperpam/commander-sdk/keeper-commander-sdks/sdk-command-reference/enterprise-management-commands/enterprise-team-commands)
2. [List Team](#list-team-command)

### Commands

### List Team Command

This command displays the list of UID and Name for each Team that logged in user has access to.

<details>

<summary>DotNet CLI</summary>

**Command**: `list-team`

**Description**: Display a list of teams available in your Keeper vault.

**Parameters:**

*No required parameters*

**Options:**

| Option           | Description                                                                                 |
| ---------------- | ------------------------------------------------------------------------------------------- |
| `-v, --verbose`  | Include team membership information in the output                                           |
| `--very-verbose` | Fetch detailed team membership information not in cache (more comprehensive than --verbose) |
| `-a, --all`      | Show all teams in your contacts, including those outside your primary organization          |
| `--sort`         | Sort teams by column: `company`, `team_uid`, or `name` (default: company)                   |

**Examples:**

```
My Vault> list-team
Found 1 team(s).

     Company          Team UID                      Name
---  ---------------  ----------------------------  ------------------
  1  Acme Corp        AbCdEfGhIjKlMnOpQrStUvWxYz     Engineering Team
```

```
My Vault> list-team --verbose
Found 2 team(s).

     Company          Team UID                      Name              Members
---  ---------------  ----------------------------  ----------------  ---------------------
  1  Acme Corp        AbCdEfGhIjKlMnOpQrStUvWxYz     Engineering Team  john@acme.com
                                                                       jane@acme.com
  2  Acme Corp        BcDeFgHiJkLmNoPqRsTuVwXyZa     Marketing Team
```

</details>

<details>

<summary>DotNet SDK</summary>

**Function**:

```csharp
Task<List<TeamListItem>> GetTeamList(TeamListOptions options = null, Action<Severity, string> logger = null);
```

**Arguments:**

| Argument  | Type                       | Required | Description                                                                      |
| --------- | -------------------------- | -------- | -------------------------------------------------------------------------------- |
| `options` | `TeamListOptions`          | No       | Configuration options for team list generation (default: null = default options) |
| `logger`  | `Action<Severity, string>` | No       | Callback for logging messages during operation (default: null)                   |

**TeamListOptions Properties:**

| Property       | Type     | Default     | Description                                                 |
| -------------- | -------- | ----------- | ----------------------------------------------------------- |
| `Verbose`      | `bool`   | `false`     | Show team membership information                            |
| `VeryVerbose`  | `bool`   | `false`     | Fetch team membership info not in cache                     |
| `ShowAllTeams` | `bool`   | `false`     | Show all teams including those outside primary organization |
| `SortBy`       | `string` | `"company"` | Sort column: `"company"`, `"team_uid"`, or `"name"`         |

**Returns:**

`Task<List<TeamListItem>>` - A task returning a list of TeamListItem objects

**TeamListItem Properties:**

| Property  | Type           | Description                                                          |
| --------- | -------------- | -------------------------------------------------------------------- |
| `TeamUid` | `string`       | Unique identifier for the team                                       |
| `Name`    | `string`       | Team display name                                                    |
| `Company` | `string`       | Enterprise/organization name                                         |
| `Members` | `List<string>` | List of team member email addresses (populated only in verbose mode) |

**Example Usage:**

```csharp
var teams = await vault.GetTeamList();
foreach (var team in teams)
{
    Console.WriteLine($"{team.Company} - {team.Name}");
}
```

</details>

<details>

<summary>Power Commander</summary>

**Command :** `Get-KeeperEnterpriseTeams [-ShowMembers] [-ShowAllMembers] [-All] [-Sort <company|team_uid|name>]`

**Parameters**

| Parameter      | Description                                                                                  |
| -------------- | -------------------------------------------------------------------------------------------- |
| ShowMembers    | Show team members from cache (fast; may be incomplete). Alias: `-v`                          |
| ShowAllMembers | Show team members and fetch from server when cache is empty (slower; complete). Alias: `-vv` |
| All            | Include teams from managed companies (MSP admin). Alias: `-a`                                |
| Sort           | Sort by: `company`, `team_uid`, or `name`.                                                   |

**Examples**

```
PS PowerCommander> Get-KeeperEnterpriseTeams -ShowAllMembers

Found 6 team(s).


# Company         Team UID               Name         Member
- -------         --------               ----         ------
1 Metron Security qwSIvyUz9n3fwwSfEYeivz example team abc@email.com
2 Metron Security lZwPcTjsBgCwewWzb7kP1Q H1           xofik412@crsay.com
3 Metron Security QVTP0wK_4boCD3VpzJ55ng NewTeam1     abc@gmail.com
4 Metron Security e5fcHJEMxEUAdeAKS_x-AQ PCTeam2      
5 Metron Security 2gHgptWRRmWAweCRgRhuuw PCTeam2      
6 Metron Security qS9qkAwwee2vl6o5UJggaagA POD Team     

PS /Users/satish/Desktop/SDK-DotNet-rebase/keeper-sdk-dotnet/PowerCommander> Get-KeeperEnterpriseTeams -All           

Found 6 team(s).


# Company         Team UID               Name
- -------         --------               ----
1 Metron Security qwSIvyUzef3gNSQEYeivzQ example team
2 Metron Security lZwPcTjsBgCq12Wzb1kP1Q H1
3 Metron Security QVTPefK_4boM_vVpzJ55ng NewTeam1
4 Metron Security e5fcHJEMxEU9-UAK11x-AQ PCTeam2
5 Metron Security 2gHgptWRRmWywhCwfRhuuw PCTeam2
6 Metron Security qS9qkAme2vl6o5UJ3faagA POD Team
```

</details>

<details>

<summary>Python CLI</summary>

**Command :** `list-team`

**Parameters**:

* `--format` Output format - Table, csv or json
* `--output` Path to resulting output file (ignored for "table" format)
* `--sort` Sort teams by column company, uid, name (default: company)

**Flags**:

* `-v`, `--verbose` Verbose output (include team membership info)
* `-vv`, `--very-verbose` Fetches team membership info not in cache
* `-a`, `--all show` All teams in your contacts (including those outside your primary

organization)

**Example:**

```sh
My Vault> list-team
  #  Company          Team UID                Name
---  ---------------  ----------------------  -------------------
  1  Keeper Security  team_uid                example team
```

</details>

<details>

<summary>Python SDK</summary>

**Function:** `load_available_teams`

```python
vault_utils.load_available_teams(auth=vault.keeper_auth)
```

</details>
