.Net and PowerShell

Additional Commander tools available in .Net and PowerShell

Overview

Keeper Commander (as described in this documentation) is written in Python and available on Github. We also have another Commander SDK which is written in .Net along with a PowerShell module that contains a subset of functionality. This page describes the .Net version of Commander.

.Net SDK

Keeper's .Net Commander tool provides basic vault access, a developer SDK for vault access and administrative functions: https://github.com/Keeper-Security/keeper-sdk-dotnet
For source integration into your .Net code, please utilize the KeeperSDK Library source code: https://github.com/Keeper-Security/keeper-sdk-dotnet/tree/release/KeeperSdk

API documentation

Developer Requirements

  • .Net Framework 4.5
  • .Net Core 2.1
  • .Net Standard 2.0

Examples

For help with implementation of SDK features, please see the Sample Application: https://github.com/Keeper-Security/keeper-sdk-dotnet/tree/master/Sample
The .Net Commander CLI Sample App contains several basic operations such as logging in, authentication with two-factor, loading and decrypting the vault and updating passwords.

PowerShell CLI

Keeper's PowerShell command-line tool (PowerCommander) provides basic vault access and administrative functions:
https://github.com/Keeper-Security/keeper-sdk-dotnet/tree/release/PowerCommander For more advanced command line capabilities, please refer to the Python-based Commander CLI.

Installation

To install the PowerCommander module for a specific user copy PowerCommander\ directory to
%USERPROFILE%\Documents\WindowsPowerShell\Modules
To install the PowerCommander module for all users copy PowerCommander\ directory to
C:\Program Files\WindowsPowerShell\Modules

Troubleshooting Installation

Unblock .dll Files
If you see the following message when trying a command, you may need to unblock the .dll files
To Unblock the .dll files, navigate to the PowerCommander folder, right click on each .dll file, select properties, click 'Unblock' in the security section, and click Apply to save changes.
If you do not see the 'Unblock' checkbox, the file is already unblocked
Make this update for each of the .dll files in the PowerCommander folder:
  • BouncyCastle.Crypto.dll
  • Google.Protobuf.dll
  • KeeperSdk.dll
  • System.Buffers.dll
  • System.Memory.dll
  • System.Runtime.CompilerServices.Unsafe.dll
Once each .dll file has been unblocked, try the PowerShell command again.
Set Execution Policy Permissions
If you are unable to run PowerCommander commands, you may need to set the Execution Policy. To check this, run the following command:
PS> Get-ExecutionPolicy -List
You will see a list like the following:
Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser Undefined
LocalMachine Undefined
If the Scope for your installation is Undefined or Restricted, set it to Unrestricted with the following command:
PS> Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
This example sets the CurrentUser scope

Commands

Cmdlet name
Alias
Description
Connect-Keeper
kc
Login to Keeper server
Sync-Keeper
ks
Sync with Keeper server
Disconnect-Keeper
Logout and clear the data
Get-KeeperLocation
kpwd
Print current Keeper folder
Set-KeeperLocation
kcd
Change Keeper folder
Get-KeeperChildItems
kdir
Display subfolder and record names in the current Keeper folder
Get-KeeperRecords
kr
Enumerate all records
Get-KeeperSharedFolders
ksf
Enumerate all shared folders
Add-KeeperRecord
kadd
Add/Modify Keeper record
Remove-KeeperRecord
kdel
Delete Keeper record
Add-KeeperFolder
kmkdir
Create Keeper Folder
Remove-KeeperFolder
krmdir
Remove Keeper Folder
Move-RecordToFolder
kmv
Move owned record to Keeper folder
Copy-KeeperToClipboard
kcc
Copy record password to clipboard
Show-TwoFactorCode
2fa
Display Two Factor Code

Examples

Connect To Keeper Account

PS > Connect-Keeper
Keeper Username: [email protected]
... Password:

List the content of Keeper folder

PS > kdir
Vault Folder: \
Mode UID Name
---- --- ----
f----- b3TMAYfOWJqNxeLjlA6v_g dasdasd
f----S BvHeHGkdRJfhGaRcI-J5Ww shared
-r-AO- 5qx_urh2EsrL0wBdi34nFw Web
-r---S ktY3jEBqwFDi9UYZSxmIpw Control
  • f - folder
  • r - record
  • S - shared
  • A - file attachments
  • O - owner

Show Two Factor Code for all records in the current Keeper folder

PS > kdir -ObjectType Record | Show-TwoFactorCode

Show Two Factor Code for all records in the Vault.

PS > kr|2fa
where
  • kr is alias for Get-KeeperRecords
  • 2fa is alias for Show-TwoFactorCode

Copy record password to clipboard

PS > 'contro' | kcc
where
  • contro is a substring of the record title. See last entry of kdir output above
  • kcc is alias for Copy-KeeperToClipboard
or
PS > 'ktY3jEBqwFDi9UYZSxmIpw' | kcc
'ktY3jEBqwFDi9UYZSxmIpw' is the Record UID of the same record

Add/Modify Keeper record

PS > kadd -Login [email protected] -GeneratePassword -URL https://company.com -Custom 'Name:John Doe' 'Record for John Doe'
creates a record in Keeper
PS > kadd -GeneratePassword -UpdateOnly 'Record for John Doe'
generates a new password

Copy owned record to folder

PS > Get-KeeperChildItem -ObjectType Record | Move-RecordToFolder 'Shared Folder'
copies all records in the current Keeper folder to the folder with name 'Shared Folder'