# External Shares Report Command

### External Shares Report

This command/function helps to display a List of direct record shares and shared-folder user memberships where the recipient is an external user.

<details>

<summary>DotNet CLI</summary>

**Command:** `audit-report --limit 50`

It returns a list of reports with created date, username, event type and message.

**Parameter:**

`limit` - Limit number of rows.

**Examples:**

```sh
My Vault> audit-report --limit 50
```

</details>

<details>

<summary>DotNet SDK</summary>

Comming Soon

</details>

<details>

<summary>PowerCommander</summary>

**Command:** `Get-KeeperExternalSharesReport`

**Parameter:**

| Parameter      | Description                                                                                          |
| -------------- | ---------------------------------------------------------------------------------------------------- |
| `-Format`      | `table` (default), `json`, or `csv`.                                                                 |
| `-Output`      | File path for `json` or `csv`. Not used for `table`.                                                 |
| `-Action`      | `none` (default): list only. `remove`: revoke external shares matching the filters.                  |
| `-ShareType`   | `all` (default), `direct` (record shares only), or `shared-folder` (shared folder user access only). |
| `-Force`       | With `-Action remove`, skip the confirmation prompt and remove immediately.                          |
| `-RefreshData` | Rebuild the compliance snapshot before evaluating external shares.                                   |

**Examples:**

```powershell
PS > Get-KeeperExternalSharesReport                             
            
uid                    name                   type          shared_to                                  permissions
---                    ----                   ----          ---------                                  -----------
cDx8KS1zVbOH1GnNHJT7_Q Gmail Account          Direct        test1@example.com                          read-only
cDx8KS1zVbOH1GnNHJT7_Q Gmail Account          Direct        test2@example.com                          read-only
Oz0yr-Ua45lsojNZAqbUQA Commander Service Mode Direct        test2@example.com                          edit,share
```

</details>

<details>

<summary>Python CLI</summary>

**Command:** `external-shares-report`

**Flag:**

`--format` : format of output {table,csv,json,pdf}.\
`--output` : path to resulting output file (ignored for "table" format).\
`-a, --action` : action to perform on external shares, 'none' if omitted {remove,none}.\
`-t, --share-type` : filter report by share type, 'all' if omitted {direct,shared-folder,all}.\
`-f, --force` : apply action w/o confirmation.\
`-r, --refresh-data` : retrieve fresh data.

**Example:**

```
External Shares Report

UID                     Name                                               Type           Shared To    Permissions
----------------------  -------------------------------------------------  -------------  -----------  -------------
LXp-qBKq0E7j7Uu_ZtMjRg  just testing                                       Direct                      read-only
Mpn1zqYkEUXTJDm3JQShfw  new-record                                         Direct                      read-only

```

</details>

<details>

<summary>Python SDK</summary>

**Function:**

```python
def run_external_shares_report(
    vault: vault_online.VaultOnline,
    include_expired: bool = False,
    share_type: str = SHARE_TYPE_ALL,
) -> ExternalSharesReportResult:
```

</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/commander-sdk/keeper-commander-sdks/sdk-command-reference/reporting-commands/external-shares-report-command.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.
