This is an unoffical Keeper Security powershell wrapper, some of the functionality is outdated but most of the functionality is still working. If you have any issues with this module/wrapper please report the issue here and not to the Keeper team.
Being able to use the Keeper security SDK with Powershell. The SDK is reliant on python and by calling python scripts in Powershell we'll be able to achieve the same result as the Keeper security cmd promt (KeeperCommander).
Be aware that having a UID using starting with '-' is not support in the powershell module but a solution for it is on its way
Keeper Security have developed a Powershell module which is WiP and have the most basic functionality ready to use. You are still welcome to use the wrapper I've created in case the PS Module isn't sufficent. Keeper Commander Powershell Module
- WinPython
- Environment variables
- KeeperCommander module for python
- Keeper security account
- Download and install WinPython
- Open "WinPython Command Prompt"
- Install Keeper commander with pip3:
$ pip3 --install keepercommander
- Right click "My Computer/This PC" choose properties
- Click on "Advanced system settings" on the left hand-side
- Click on "Environment Variables..." in the bottom right corner
- In the first section named User varaibles for %username% Highlight the Variable named Path
- Click on the button "Edit"
- Click on the button New on the right-hand-side
- Add the location of the python folder which is located inside the WinPython installation folder
- Click Ok
- A restart might be required...
Or
Run the following environment variable script snippet in for example Powershell
$pythonPath = "<Location of python folder e.g. C:\WPy-3670\python-3.6.7.amd64>"
[Environment]::SetEnvironmentVariable("Path", "$env:Path;$pythonPath", "User")
A Keeper Security account is required, "Keeper is free for local password management on your device. Premium subscriptions provides cloud-based capabilites including multi-device sync, shared folders, teams, SSO integration and encrypted file storage. Keeper Security Test and work has only been done on Cloud account and Enterprise account not local accounts
Install Powershell
By downloading the module from here you'll get the module, manifest and all python scripts required for the module to work (you might want to remove the -master part of the folder once un-zipped). Move the module folder to the Powershell module folder <C:\Program Files\WindowsPowerShell\Modules>
Open a Powershell window (note: you'll get a warning message of verbs not being used correctly, you can ignore that)
C:\PS> Import-Module keepersecurity.powershell
To verify that the installation of python and the configuration of the environment variables is done successfully, open the WinPython Command Prompt and type the following.
$ python --version
if you get the python version as response you've succeded
To verify that the Keeper commander module has been loaded type the following in the WinPython Command Prompt:
$ keeper
if you're prompted with commands for the keeper module the installation has been successful.
To verfiy that the keepersecurity.powershell module is loaded type the following in a powershell window
C:\PS> Get-Module -Name keepersecurity.powershell
If you get the following output the module is loaded
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 1.0 keepersecurity.powershell {Add-KeeperRecordNotes, Del-KeeperEnterpriseTeam...}
The following examples show you how to run the scripts by themself or by using the Powershell module
python C:\Keper\get-keeperrecord.py --ausername <Username> --apassword <Password> --record "tKvMeXApaOEzhkCkQRtAcw" --format "json"
Make sure the keepersecurity.powershell module is loaded, see installation step above. Once the module is loaded you can use the functions.
'Add-KeeperRecordNotes',
'Del-KeeperEnterpriseTeam',
'Del-KeeperEnterpriseUser',
'Del-KeeperFolder',
'Del-KeeperRecord',
'Del-KeeperRecordAttachment',
'Get-KeeperAuditLog',
'Get-KeeperAuditReport',
'Get-KeeperEnterpriseInfo',
'Get-KeeperFolder',
'Get-KeeperRecord',
'Get-KeeperRecordAttachment',
'Link-KeeperFolder',
'Link-KeeperRecord',
'List-KeeperFolder',
'List-KeeperRecord',
'Move-KeeperFolder',
'New-KeeperEnterpriseTeam',
'New-KeeperEnterpriseUser',
'New-KeeperRecord',
'New-KeeperRecordAttachment',
'New-KeeperSharedFolder',
'New-KeeperUser',
'New-KeeperUserFolder',
'Search-KeeperRecord',
'Set-KeeperEnterpriseRole',
'Set-KeeperEnterpriseTeam',
'Set-KeeperSharedFolderPermissions',
'Set-KeeperSharedRecordPermissions',
'Push-KeeperEnterpriseDefaultRecords'
The functions require a keeper security account, to be run the account credentials will have to be stored in a [pscredential] object and sent as input with each function.
$authuser = "<username>"
$authpass = "<password>"
$password = $authpass | ConvertTo-SecureString -AsPlainText -Force
$credential = New-Object System.Management.Automation.PsCredential($authuser,$password)
Running one of the modules functions,
# The following module function will display a specified records information in a JSON string
Get-KeeperRecord -Identity "<recordUid>" -Format json -AuthObject $credentials
I feel like explaning the setup and why it's done as it is. Keeper Security provide us with a SDK where we get to use a python based cmd prompt and a module for all commands Keeper provide us with. Keeper Security have made the decision to make the access through their own module as there's different stages of encrypting the data sent to their API.
This repository is built on Python scripts which in the back end is using the Keeper Commander functionality. The python scripts can be run by any programming or scripting language which have the capability to run python.
In this build we are using Powershell as a front and calling python scripts in the back with arguments for the different functionality within the Keeper Commander hence the prerequisities of python and Keeper commander.
- KeeperCommander - The SDK used
- WinPython - Backend scripts using
- Powershell - The main framework used
Feel free to submit a Pull request...
For the versions available, see the tags on this repository.
- Tony Langlet - Initial work - TonyLanglet
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details
- Would like to thank the Keeper Security (keepercommander) staff for the fast response when in need of help.
- Would like to give credits to @JimPahlAtSkyline whos been testing functionality in the Module.