.Net and PowerShell
Additional Commander tools available in .Net and PowerShell

.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:
1
PS> Get-ExecutionPolicy -List
Copied!
You will see a list like the following:
1
Scope ExecutionPolicy
2
----- ---------------
3
MachinePolicy Undefined
4
UserPolicy Undefined
5
Process Undefined
6
CurrentUser Undefined
7
LocalMachine Undefined
Copied!
If the Scope for your installation is Undefined or Restricted, set it to Unrestricted with the following command:
1
PS> Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
Copied!
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

1
PS > Connect-Keeper
2
Keeper Username: [email protected]
3
... Password:
Copied!

List the content of Keeper folder

1
PS > kdir
2
3
Vault Folder: \
4
5
6
Mode UID Name
7
---- --- ----
8
f----- b3TMAYfOWJqNxeLjlA6v_g dasdasd
9
f----S BvHeHGkdRJfhGaRcI-J5Ww shared
10
-r-AO- 5qx_urh2EsrL0wBdi34nFw Web
11
-r---S ktY3jEBqwFDi9UYZSxmIpw Control
Copied!
  • f - folder
  • r - record
  • S - shared
  • A - file attachments
  • O - owner

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

1
PS > kdir -ObjectType Record | Show-TwoFactorCode
Copied!

Show Two Factor Code for all records in the Vault.

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

Copy record password to clipboard

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

Add/Modify Keeper record

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

Copy owned record to folder

1
PS > Get-KeeperChildItem -ObjectType Record | Move-RecordToFolder 'Shared Folder'
Copied!
copies all records in the current Keeper folder to the folder with name 'Shared Folder'
Last modified 3mo ago