KanBo PowerShell Commandlets

Table of Contents

KanBo configuration

  1. Create a pair of self-signed certificates.
  2. Open the KanBo appsettings.json file and paste the code below:
{
        "type": "auth.app",
        "issuer": "kanbo-cmdlet",
        "children": [
          {
            "type": "signature",
            "algo": "rs256",
            "children": [
              [
                "cert",
                {
                  "type": "x509-file",
                  "file": "PFX CERT-PATH",
                  "key": "CERT-PASS"
                }
              ]
            ]
          },
          [
            "mapper",
            {
              "type": "user",
              "roles": "security:aad"
            }
          ]
        ]
      },
  1. Change “PFX CERT-PATH” to the path of your .pfx certificate and “CERT-PASS” to its password.
  2. Save the appsettings.json file, and then restart KanBo.

Using the commandlets

  1. Extract the contents of the ZIP file to your desired location.

The Commandlet ZIP file is only available upon request.
Please contact us to receive it.

  1. Import the module by running the following command:
Import-Module PATH\KanBo.Cmdlet.dll
  1. Change the “PATH” variable to the location where you extracted the ZIP file.
  2. Enter the following commands, providing the required variables. These are the essential parameters for each command, but additional options may be available:
  • CertificatePath – full path to your .pfx certificate,
  • CertificatePassword – password of your .pfx certificate,
  • KanBoUrl – URL of your KanBo with “https://”,
  • Issuer – with value of “kanbo-cmdlet”,
  • UserId – ID of the KanBo user to be impersonated.

List of commandlets

Add-Card 

Adds a card to a specified space or status. 

Parameters: 

  • CertificatePath (string) – Required 
  • CertificatePassword (string) – Required 
  • KanBoUrl (string) – Required 
  • Issuer (string) – Required 
  • UserId (int) – Required 
  • Name (string) – Required 
  • SpaceId (int) – Optional 
  • StatusId (int) – Optional 

Output: None 

Add-Space 

It adds a new space to a workspace and can optionally create or attach a Microsoft Teams channel.

Parameters: 

  • CertificatePath (string) – Required 
  • CertificatePassword (string) – Required 
  • KanBoUrl (string) – Required 
  • Issuer (string) – Required 
  • UserId (int) – Required 
  • WorkspaceId (int) – Required 
  • Name (string) – Required 
  • ChannelId (string) – Optional 
  • TemplateId (int) – Optional 
  • IconColor (int) – Optional 
  • Icon (int) – Optional 

Output: SpaceId (int) 

Add-User 

Adds a user to KanBo and activates them automatically.

Parameters: 

  • CertificatePath (string) – Required 
  • CertificatePassword (string) – Required 
  • KanBoUrl (string) – Required 
  • Issuer (string) – Required 
  • UserId (int) – Required 
  • LoginType (string) – Required 
  • LoginName (string) – Required 

Output: AddedUserId (int) 

Add-Workspace

It adds a workspace to KanBo and can optionally create or attach a group or team.

Parameters: 

  • CertificatePath (string) – Required 
  • CertificatePassword (string) – Required 
  • KanBoUrl (string) – Required 
  • Issuer (string) – Required 
  • UserId (int) – Required 
  • Name (string) – Required 
  • GroupId (string) – Optional

Output: WorkspaceId (int) 

Close-Space 

Closes the selected space based on its ID. 

Parameters:

  • CertificatePath (string) – Required 
  • CertificatePassword (string) – Required 
  • KanBoUrl (string) – Required 
  • Issuer (string) – Required 
  • UserId (int) – Required 
  • SpaceId (int) – Required 

Output: None 

Get-SpaceTemplates

Retrieves a list of KanBo templates.

Parameters:

  • CertificatePath (string) – Required 
  • CertificatePassword (string) – Required 
  • KanBoUrl (string) – Required 
  • Issuer (string) – Required 
  • UserId (int) – Required 

Output: Templates (List) 

Get-User

Retrieves a KanBo user based on their ID. 

Parameters: 

  • CertificatePath (string) – Required 
  • CertificatePassword (string) – Required 
  • KanBoUrl (string) – Required 
  • Issuer (string) – Required 
  • UserId (int) – Required 
  • Id (int) – Required 

Output: User (User)

Get-Workspace 

Retrieves a workspace based on an M365 Group ID. 

Parameters:

  • CertificatePath (string) – Required 
  • CertificatePassword (string) – Required 
  • KanBoUrl (string) – Required 
  • Issuer (string) – Required 
  • UserId (int) – Required 
  • GroupId (string) – Required 

Output: Workspaces (Dictionary<int, string>) 

Disable-User 

Deactivates a KanBo user based on their profile key.

Parameters: 

  • CertificatePath (string) – Required 
  • CertificatePassword (string) – Required 
  • KanBoUrl (string) – Required 
  • Issuer (string) – Required 
  • UserId (int) – Required 
  • ProfileKey (string) – Required 

Output: None

Remove-Space

This deletes a space from KanBo and provides the option to remove associated MS Teams resources.

Parameters:

  • CertificatePath (string) – Required 
  • CertificatePassword (string) – Required 
  • KanBoUrl (string) – Required 
  • Issuer (string) – Required 
  • UserId (int) – Required 
  • SpaceId (int) – Required 
  • RemoveResources (bool) – Required 

Output: None 

Remove-SpacesFromWorkspace 

It removes all spaces from a selected workspace and has an option to remove associated MS Teams resources.

Parameters: 

  • CertificatePath (string) – Required 
  • CertificatePassword (string) – Required 
  • KanBoUrl (string) – Required 
  • Issuer (string) – Required 
  • UserId (int) – Required 
  • WorkspaceId (int) – Required 
  • RemoveResources (bool) – Required 

Output: None

Remove-Workspace

This removes a workspace from KanBo and gives you the option to remove any associated MS Teams resources.

Parameters:

  • CertificatePath (string) – Required 
  • CertificatePassword (string) – Required 
  • KanBoUrl (string) – Required 
  • Issuer (string) – Required 
  • UserId (int) – Required 
  • WorkspaceId (int) – Required 
  • RemoveResources (bool) – Required

Output: None 

Set-UserLicense

Changes the type of a user’s license.

Parameters:

  • CertificatePath (string) – Required 
  • CertificatePassword (string) – Required 
  • KanBoUrl (string) – Required 
  • Issuer (string) – Required 
  • UserId (int) – Required 
  • Id (int) – Required 
  • LicenseType (UserLicenseType) – Required 

Output: None 

Models 

BoardTemplate 

  • Id (int) 
  • Name (string) 
  • Position (int) 

User 

  • Name (string) 
  • ProfileKey (string) 
  • Email (string) 
  • Active (bool) 
  • LicenseType (UserLicenseType) 
  • Id (int) 

UserLicenseType 

  • Writer = 2 
  • Reader = 1 
  • None = 0 

Was this article helpful?

Please, contact us if you have any additional questions.