KanBo Powershell Comandlets

Table of Contents

Configure KanBo

  1. Create a pair of self-signed certificates
  2. Paste the code below into your appsettings.json:

{
        "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"
            }
          ]
        ]
      },

Change “PFX CERT-PATH” to the path of Your .pfx certificate and the “CERT-PASS” to the password of the certificate

  1. Save the appsettings.json and restart KanBo

Using the commandlet

  1. Extract 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:
Import-Module PATH\KanBo.Cmdlet.dll
  1. Change “PATH” to the location where you extracted the ZIP file.
  2. Use the following commands, ensuring you provide 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 

Adds a new space to a workspace, optionally creating or attaching 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 automatically activates the user. 

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 

Adds a workspace to KanBo, optionally creating or attaching a group/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 a 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 KanBo templates as a list. 

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 O365 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 user in KanBo 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 

Deletes a space from KanBo, with an 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 

Removes all spaces from a selected workspace, with 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 

Removes a workspace from KanBo, with 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 

 

Set-UserLicense 

Changes a user’s license to a specified type. 

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