# MSP Management Commands

### Overview <a href="#msp-management-commands-1" id="msp-management-commands-1"></a>

This subset of commands applies to **MSP (Managed Service Provider)** accounts. They allow you to manage managed companies (MCs), refresh MSP data, switch context between MSP and a managed company, and convert an enterprise node into a managed company.

**Commands**:

* [MSP List Command](#msp-list)
* [MSP Refresh Data Command](#msp-refresh-data)
* [MSP Create Command](#msp-create)
* [MSP Update Command](#msp-update)
* [MSP Delete Command](#msp-delete)
* [MSP Login Command (Switching to MC)](#msp-login-switch-to-mc)
* [Convert Enterprise Node to MSP Command](#msp-convert-node)
* [Switch to MSP Command](#msp-switch-to-msp)

### Managed Company List

Retrieves and displays a table of all managed companies for the MSP. Each row contains company name, ID, node, plan, storage, addons, seats allowed, seats used, and paused status. Available only when logged in with an MSP-licensed account.

<details>

<summary>DotNet CLI</summary>

**Command:** `mc-list` or `msp-info` or `mi`

**Flags:** None

**Example:**

```sh
My Vault> mc-list
  #  Company Name             Company ID  Node                 Plan             Storage       Addons                              Seats Allowed  Seats Used  Paused
---  -----------------------  ----------  -------------------  ---------------  ------------  ----------------------------------  -------------  ----------  ------
  1  21Jan                    311310      abc.                 Business         STORAGE_1TB                                                   0           0        
  2  ADD NO ADDON             310855      ace                  Enterprise       100GB                                                 Unlimited           1        
  3  ADD ON PREM              310858      abe.                 Business         100GB         Keeper Connection Manager (KCM)         Unlimited           0        
  4  ADD11                    310854      aid                  Business Plus    STORAGE_1TB   Advanced Reporting & Alerts Module      Unlimited           1        
                                                                                              BreachWatch                                                          
  5  ADD123                   310852      acme                 Business Plus    STORAGE_1TB   Advanced Reporting & Alerts Module      Unlimited           0        
                                                                                              BreachWatch                                                          
                                                                                              remote_browser_isolation                                             
  6  Adayaa Dev Inc           311536      abcde.               Business         STORAGE_10TB  keeper_endpoint_privilege_manager              10           0                                            
```

</details>

<details>

<summary>DotNet SDK</summary>

Managed company list can be obtained from the SDK when the enterprise loader includes `ManagedCompanyData` and the account has MSP license:

```csharp
// When context.Enterprise includes ManagedCompanyData (MSP account)
var managedCompanies = context.RoleManagement.Enterprise.GetPlugins()
    .OfType<ManagedCompanyData>()
    .FirstOrDefault();
if (managedCompanies != null)
{
    foreach (var mc in managedCompanies.ManagedCompanies)
    {
        Console.WriteLine($"{mc.EnterpriseName} (ID: {mc.EnterpriseId})");
    }
}
```

</details>

<details>

<summary>PowerCommander</summary>

**Command:** `Get-KeeperManagedCompany`

**Aliases:** `kmc`

**Flags:**

<table><thead><tr><th width="193.6494140625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Restriction</strong></td><td>Show MSP permits: unlimited licenses, allowed products, allowed add-ons, max file plan. Output is list-style for readability.</td></tr><tr><td><strong>Pricing</strong></td><td>Show BI subscription pricing (products, add-ons, file plans) with currency and unit.</td></tr><tr><td><strong>Filter</strong></td><td>Optional partial filter on MC name; ignored when using <code>-Restriction</code>, <code>-Pricing</code>, or <code>-ManagedCompany</code>.</td></tr><tr><td><strong>Detailed</strong></td><td>Full MC list: company_id, company_name, node, node_name, plan, storage, addons (with seats), allocated, active; sorted by name.</td></tr><tr><td><strong>ManagedCompany</strong></td><td>Filter to a <strong>single</strong> MC by exact name or ID. Use with <code>-Detailed</code> for one MC’s details.</td></tr><tr><td><strong>Format</strong></td><td><code>table</code> (default), <code>json</code>, or <code>csv</code>.</td></tr><tr><td><strong>Output</strong></td><td>If set, write results to this file path.</td></tr></tbody></table>

**Example:**

```powershell
PS> Get-KeeperManagedCompany 

EnterpriseId EnterpriseName                                     ProductId      NumberOfSeats NumberOfUsers FilePlanType  IsExpired     ParentNodeId NodeName            Addons
------------ --------------                                     ---------      ------------- ------------- ------------  ---------     ------------ --------            ------
      309488 test ppppppp etc                                   business          2147483647             0 STORAGE_100GB     False 1169425105420290 Maaaaaalll          keeper_endpoint_privilege_manager
      308504 new test updated                                   business          2147483647             0 STORAGE_100GB     False 1169425105420290 Meeeeeeoooo          

PS> Get-KeeperManagedCompany -ManagedCompany tests2

EnterpriseId EnterpriseName ProductId      NumberOfSeats NumberOfUsers FilePlanType IsExpired     ParentNodeId NodeName   Addons
------------ -------------- ---------      ------------- ------------- ------------ ---------     ------------ --------   ------
      315830 tests2         enterprisePlus            13             1 STORAGE_1TB      False 1169425105420290 Metronlabs enterprise_breach_watch, enterprise_audit_and_reporting
```

</details>

<details>

<summary>Python CLI</summary>

Coming Soon

</details>

<details open>

<summary>Python SDK</summary>

Coming Soon

</details>

### MSP Refresh Data <a href="#msp-refresh-data" id="msp-refresh-data"></a>

Refreshes local enterprise/MSP data from the server. Use after making changes or to ensure you have the latest managed company list and licenses.

<details>

<summary>DotNet CLI</summary>

**Command:** `enterprise-get-data` or `msp-down` or `md`

**Flags:** None

**Example:**

```sh
My Vault> enterprise-get-data
My Vault> md
```

</details>

<details>

<summary>DotNet SDK</summary>

**Function:** Reload enterprise data (including MSP data when applicable)

```csharp
await context.Enterprise.Load();
```

</details>

<details>

<summary>PowerCommander</summary>

**Command:** `Sync-KeeperEnterprise`

Use after switching MC/MSP or to refresh MSP data.

**Example:**

```powershell
PS> Sync-KeeperEnterprise
```

</details>

<details>

<summary>Python CLI</summary>

Coming Soon

</details>

<details>

<summary>Python SDK</summary>

Coming Soon

</details>

### MSP Create <a href="#msp-create" id="msp-create"></a>

Creates a new managed company with the given name, plan, seats, and optional node, storage, and addons. The [add-ons are mentioned here](#msp-addon-options).

<details>

<summary>DotNet CLI</summary>

**Command:** `mc-create <NAME>` or `msp-add` or `ma`

**Flags:**

* `--product` or `-p` : Product plan: `business`, `businessPlus`, `enterprise`, `enterprisePlus`
* `--seats` or `-s` : Maximum number of seats (-1 = unlimited)
* `--node` : Node name or ID (default: root)
* `--storage` : Storage plan: `100GB`, `1TB`, `10TB`
* `--addons` : Comma-separated addons , e.g. `secrets_manager,connection_manager:5`

**Example:**

```sh
My Vault> mc-create "New MC" --product=enterprise --seats=10
"new_mc_1" --seats=15 --product=enterprise --node=test1 --storage=100GB --addons="secrets_manager,enterprise_breach_watch"                   
Managed Company "new_mc_1", ID:314913 has been created.
```

</details>

<details>

<summary>DotNet SDK</summary>

**Function:** `CreateManagedCompany(ManagedCompanyOptions options)`

**Example:**

```csharp
var options = new ManagedCompanyOptions
{
    Name = "New MC",
    ProductId = "enterprise",
    NumberOfSeats = 10,
    FilePlanType = "1TB",
    NodeId = nodeId 
};
var mc = await managedCompanyData.CreateManagedCompany(options);
Console.WriteLine($"Created MC: {mc.EnterpriseName}, ID: {mc.EnterpriseId}");
```

</details>

<details>

<summary>PowerCommander</summary>

**Command:** `New-KeeperManagedCompany`

**Aliases:** `kamc`

**Flags:**

<table><thead><tr><th width="145.6708984375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>Display name of the new MC.</td></tr><tr><td><strong>PlanId</strong></td><td>License plan: <code>business</code>, <code>businessPlus</code>, <code>enterprise</code>, <code>enterprisePlus</code>.</td></tr><tr><td><strong>MaximumSeats</strong></td><td>Maximum number of seats (licenses).</td></tr><tr><td><strong>Storage</strong></td><td>File storage plan: <code>100GB</code>, <code>1TB</code>, <code>10TB</code>.</td></tr><tr><td><strong>Addons</strong></td><td>Array of add-on names; use <code>AddonName:Seats</code> for add-ons with seats (e.g. <code>connection_manager:5</code>).</td></tr><tr><td><strong>Node</strong></td><td>Node name or ID to attach the MC to. If omitted, root node is used.</td></tr></tbody></table>

**Example:**

```powershell
PS> New-KeeperManagedCompany -Name "New MC" -PlanId enterprise -MaximumSeats 10
PS> New-KeeperManagedCompany -Name "New MC" -PlanId enterprise -MaximumSeats 10 -Storage 1TB -Node "Branch"
PS> New-KeeperManagedCompany -Name "new_mc_2" -PlanId enterprise -MaximumSeats 15 -Storage 100GB -Node test1 -Addons "secrets_manager,enterprise_breach_watch"
```

</details>

<details>

<summary>Python CLI</summary>

Coming Soon

</details>

<details>

<summary>Python SDK</summary>

Coming Soon

</details>

### MSP Update <a href="#msp-update" id="msp-update"></a>

Updates an existing managed company’s name, product, seats, storage, node, or addons.

<details>

<summary>DotNet CLI</summary>

**Command:** `mc-update <COMPANY>` or `msp-update` or `mu`

**Flags:**

* `--name` : New managed company name
* `--product` or `-p` : Product plan
* `--seats` or `-s` : Maximum seats
* `--node` : Node name or ID
* `--storage` : Storage plan
* `--addons` : Comma-separated addons

**Value:** `COMPANY` = managed company name or ID (required)

**Example:**

```sh
My Vault> mc-update 3861 --seats=20 --product=enterprisePlus
My Vault> mc-update "Company 1" --name="Company 1 Updated"
Managed Company "Company 1 Updated", ID:3861 has been updated.
```

</details>

<details>

<summary>DotNet SDK</summary>

**Function:** `UpdateManagedCompany(int companyId, ManagedCompanyOptions options)`

**Example:**

```csharp
var options = new ManagedCompanyOptions
{
    NumberOfSeats = 20,
    ProductId = "enterprisePlus"
};
var updated = await managedCompanyData.UpdateManagedCompany(3861, options);
```

</details>

<details>

<summary>PowerCommander</summary>

**Command:** `Edit-KeeperManagedCompany`

**Aliases:** `kemc`

**Flags:**

* `-Id` : Managed company name or ID (required, position 0)
* `-Name` : New name
* `-PlanId` : Plan
* `-MaximumSeats` : Seats
* `-Storage` : 100GB, 1TB, 10TB
* `-Addons` : Addons
* `-Node` : Node name or ID

**Example:**

```powershell
PS> Edit-KeeperManagedCompany -Id 3861 -MaximumSeats 20 -PlanId enterprisePlus
PS> Edit-KeeperManagedCompany -Id new_mc_2 -Name "New Managed Company"                                                              
                          
CompanyId CompanyName         PlanId     PlanName   FilePlanName Allocated Active
--------- -----------         ------     --------   ------------ --------- ------
314915    New Managed Company enterprise Enterprise 100GB               15      0
```

</details>

<details>

<summary>Python CLI</summary>

Coming Soon

</details>

<details>

<summary>Python SDK</summary>

Coming Soon

</details>

### MSP Delete <a href="#msp-delete" id="msp-delete"></a>

Removes a managed company by name or ID.

<details>

<summary>DotNet CLI</summary>

**Command:** `mc-delete <COMPANY>` or `msp-remove` or `mrm`

**Flags:** None

**Value:** `COMPANY` = managed company name or ID (required)

**Example:**

```sh
My Vault> mc-delete 3861
My Vault> mc-delete "Company 1"
Managed Company "Company 1", ID:3861 has been removed.
```

</details>

<details>

<summary>DotNet SDK</summary>

**Function:** `RemoveManagedCompany(int companyId)`

**Example:**

```csharp
await managedCompanyData.RemoveManagedCompany(3861);
```

</details>

<details>

<summary>PowerCommander</summary>

**Command:** `Remove-KeeperManagedCompany`

**Aliases:** `krmc`

**Flags:**

* Position 0 : Managed company name or ID (required)

**Example:**

```powershell
PS> Remove-KeeperManagedCompany 3861
PS> Remove-KeeperManagedCompany "Company 1"
```

</details>

<details>

<summary>Python CLI</summary>

Coming Soon

</details>

<details>

<summary>Python SDK</summary>

Coming Soon

</details>

### MSP Login (Switch to MC) <a href="#msp-login-switch-to-mc" id="msp-login-switch-to-mc"></a>

Switches the CLI context to a managed company so that subsequent commands run in that MC’s context. DotNet CLI uses a dedicated MC context; PowerCommander sets the current managed company ID and syncs.

<details>

<summary>DotNet CLI</summary>

**Command:** `mc-login <MC_COMPANY_ID>`

**Flags:** None

**Value:** `MC_COMPANY_ID` = managed company ID (required). Use `mc-list` to see IDs.

**Example:**

```sh
My Vault> mc-login 3987
# Prompt changes to "Managed Company"; subsequent commands run in MC context
```

</details>

<details>

<summary>DotNet SDK</summary>

**Function:** `LoginToManagedCompany(IEnterpriseLoader enterprise, int mcEnterpriseId)` (on `ManagedCompanyAuth`)

**Example:**

```csharp
var mcAuth = new ManagedCompanyAuth();
await mcAuth.LoginToManagedCompany(enterprise, 3987);
// Use mcAuth as the new auth/enterprise context for MC operations
```

</details>

<details>

<summary>PowerCommander</summary>

**Command:** `Switch-KeeperMC`

**Aliases:** `switch-to-mc`

**Flags:**

* `-Name` (position 0) : Managed company ID or name (required)

**Example:**

```powershell
PS> Switch-KeeperMC 3987
PS> switch-to-mc "Company Name"
Switched to MC "Company Name"
```

</details>

<details>

<summary>Python CLI</summary>

Coming Soon

</details>

<details>

<summary>Python SDK</summary>

Coming Soon

</details>

### MSP Copy Role <a href="#msp-convert-node" id="msp-convert-node"></a>

Copy one or more **roles** (with their **enforcements**) from the MSP enterprise into one or more Managed Companies.

<details>

<summary>DotNet CLI</summary>

Coming Soon

</details>

<details>

<summary>DotNet SDK</summary>

**Function:** `ConvertNodeToManagedCompanyAsync(NodeToManagedCompanyRequest request)`

**Example:**

```csharp
var request = new NodeToManagedCompanyRequest { CompanyId = companyId };
// Optionally populate Nodes, Roles, Users, RoleKeys, TeamKeys, UsersDataKeys
// with re-encrypted data for the MC.
await managedCompanyData.ConvertNodeToManagedCompanyAsync(request);
await enterprise.Load();
```

</details>

<details>

<summary>PowerCommander</summary>

**Command:**

```
Copy-KeeperMCRole
```

**Flags:**

<table><thead><tr><th width="207.7509765625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Role</strong></td><td>Source role <strong>name</strong> or <strong>ID</strong>. Can be repeated (e.g. multiple roles). Resolved in the MSP enterprise.</td></tr><tr><td><strong>ManagedCompany</strong></td><td>Target MC <strong>name</strong> or <strong>ID</strong>. Can be repeated (e.g. multiple MCs).</td></tr></tbody></table>

Example:

```ps1
PS> Copy-KeeperMCRole -Role "Auditor", "Help Desk" -ManagedCompany "Acme"
```

</details>

<details>

<summary>Python CLI</summary>

Coming Soon

</details>

<details>

<summary>Python SDK</summary>

Coming Soon

</details>

### MSP Switch to MSP <a href="#msp-switch-to-msp" id="msp-switch-to-msp"></a>

Switches context back to MSP when currently in a managed company context. Basically logs you out of managed company.

<details>

<summary>DotNet CLI</summary>

**Command:** `switch-to-msp` or `msp`

**Flags:** None

**Example:**

```sh
Managed Company> switch-to-msp
Managed Company> msp
# Or use "exit" to return to MSP context
# Prompt returns to "My Vault"
```

</details>

<details>

<summary>DotNet SDK</summary>

No direct SDK call; context switching is handled by the CLI/shell. When using `ManagedCompanyAuth`, the application would switch back to the parent auth/context that was stored when entering MC context.

</details>

<details>

<summary>PowerCommander</summary>

**Command:** `Switch-KeeperMSP`

**Aliases:** `switch-to-msp`

**Flags:** None

**Example:**

```powershell
PS> Switch-KeeperMSP
PS> switch-to-msp
Switched to MSP
```

</details>

<details>

<summary>Python CLI</summary>

Coming Soon

</details>

<details>

<summary>Python SDK</summary>

Coming Soon

</details>

### MSP Billing Report Command <a href="#msp-delete" id="msp-delete"></a>

Generate the **MSP Consumption Billing Statement** for a given month. Requires MSP account.

<details>

<summary>DotNet CLI</summary>

**Command:** `mc-delete <COMPANY>` or `msp-remove` or `mrm`

**Flags:** None

**Value:** `COMPANY` = managed company name or ID (required)

**Example:**

```sh
My Vault> mc-delete 3861
My Vault> mc-delete "Company 1"
Managed Company "Company 1", ID:3861 has been removed.
```

</details>

<details>

<summary>DotNet SDK</summary>

**Function:** `RemoveManagedCompany(int companyId)`

**Example:**

```csharp
await managedCompanyData.RemoveManagedCompany(3861);
```

</details>

<details>

<summary>PowerCommander</summary>

**Command:** `Get-MspBillingReport`

**Parameters**

<table><thead><tr><th width="185.98828125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Month</strong></td><td>Month as <strong>1–12</strong> (numeric) or <strong>YYYY-MM</strong> (e.g. <code>2022-02</code>). If omitted, <strong>previous calendar month</strong> is used.</td></tr><tr><td><strong>Year</strong></td><td>Year (e.g. <code>2022</code>). Used when <strong>Month</strong> is numeric only.</td></tr><tr><td><strong>ShowDate</strong></td><td>Break down the report by date.</td></tr><tr><td><strong>ShowCompany</strong></td><td>Break down the report by managed company.</td></tr><tr><td><strong>Format</strong></td><td><code>table</code> (default), <code>json</code>, or <code>csv</code>.</td></tr><tr><td><strong>Output</strong></td><td>If set, save the report to this file path.</td></tr></tbody></table>

**Examples:**

```ps1
# Previous month (default)
Get-MspBillingReport

# Specific month
Get-MspBillingReport -Year 2025 -Month 11  
Consumption Billing Statement: November 2025


Product                        Licenses Rate AvgPerDay InitialLicenses FinalLicenses MaxLicenses
-------                        -------- ---- --------- --------------- ------------- -----------
enterprise                           30          1.000               1             1           1
enterprise_audit_and_reporting       30          1.000               1             1           1
enterprise_breach_watch              30          1.000               1             1           1
compliance_report                    30          1.000               1             1           1

=======================================================================================
Get-MspBillingReport -Year 2026 -Month 1  
Consumption Billing Statement: January 2026


Product                           Licenses Rate AvgPerDay InitialLicenses FinalLicenses MaxLicenses
-------                           -------- ---- --------- --------------- ------------- -----------
business                                31          1.000               1             1           1
enterprise                              64          2.060               2             3           3
enterprisePlus                          30          0.970               0             2           3
Product 10000                           60          1.940               1             3           3
enterprise_audit_and_reporting          58          1.870               1             2           2
enterprise_breach_watch                 31          1.000               1             1           1
msp_service_and_support                 29          0.940               0             2           2
compliance_report                       60          1.940               1             3           3
secrets_manager                          0          0.000               0             0           0
connection_manager                      64          2.060               0             3           3
remote_browser_isolation                64          2.060               0             3           3
privileged_access_manager               48          1.550               0             3           3
keeper_endpoint_privilege_manager        0          0.000               0             0           0
```

</details>

<details>

<summary>Python CLI</summary>

Coming Soon

</details>

<details>

<summary>Python SDK</summary>

Coming Soon

</details>

### MSP Addon Options

* compliance\_report
* enterprise\_audit\_and\_reporting
* secrets\_manager
* enterprise\_breach\_watch
* onboarding\_and\_certificate
* msp\_service\_and\_support
* connection\_manager
* chat
* password\_rotation
* remote\_browser\_isolation
* privileged\_access\_manager
* keeper\_endpoint\_privilege\_manager
