Usage
Revised: October 29, 2025
Service accounts and other non-interactive logins can access credentials you store for them.
And of course you can always use PowerPass with your own login, too.
Login to the system with your account, or the service account you use for automation, deploy PowerPass, and use Write-PowerPassSecret to store a credential for that account.
Keep in mind that you should NOT be using Run as administrator in Windows when interfacing with PowerPass.
The credentials you store while logged in will only be accessible to that same account.
The PowerPass module, Lockers, keys, and salts are all contained within the user’s profile directory and everything is encrypted. On the AES edition you can now change where your Locker and key are stored to place them on external storage or remote locations. The How It Works article explains the technical workings in detail. To incorporate PowerPass into your scritps and modules, follow these examples.
Reading and Writing Secrets
- To read a secret from PowerPass use the
Read-PowerPassSecretcmdlet. - To write a secret into PowerPass use the
Write-PowerPassSecretcmdlet. - To remove a secret from PowerPass use the
Remove-PowerPassSecretcmdlet. - To import secerts from KeePass 2 use the
Import-PowerPassSecretscmdlet. (DP API edition only)
Reading and Writing Files
- To get the list of files in PowerPass use the
Get-PowerPassAttachmentscmdlet. - To read a file from PowerPass use the
Read-PowerPassAttachmentcmdlet. - To write a file into PowerPass use the
Write-PowerPassAttachmentcmdlet. - To remove a file from PowerPass use the
Remove-PowerPassAttachmentcmdlet. - To add multiple files to PowerPass at once from disk use the
Add-PowerPassAttachmentcmdlet. - To export multiple files from PowerPass back to disk use the
Export-PowerPassAttachmentcmdlet.
Back Up, Restore, and Maintenance
- To export a copy of all your secrets and files use the
Export-PowerPassLockercmdlet. - To import secrets and files previously exported use the
Import-PowerPassLockercmdlet. - To erase all secrets and files from PowerPass use the
Clear-PowerPassLockercmdlet. - To rotate your PowerPass Locker keys use the
Update-PowerPassKeycmdlet. - To change where your Locker is stored use the
Set-PowerPasscmdlet. (AES edition only)
Utilities
- To generate a random password use the
New-PowerPassRandomPasswordcmdlet. - To get PowerPass information use the
Get-PowerPasscmdlet.
Full Cmdlet Reference
- For the AES edition: PowerPass AES Cmdlet Reference
- For the DP API edition: PowerPass DP API Cmdlet Reference
Getting Secrets from KeePass 2
- To open a KeePass 2 database use the
Open-PowerPassDatabasecmdlet. (DP API edition only) - Pipe or pass the output to
Get-PowerPassSecretto fetch secrets from the KeePass 2 database. (DP API edition only)
Storing KeePass 2 Database Passwords in PowerPass
- To import secerts from KeePass 2 into PowerPass use the
Import-PowerPassSecretscmdlet. (DP API edition only)
Use Case: Automating Access to Active Directory
One of the most common scenarios is automating access to Active Directory. Configuring a script to run with Domain Admin permissions is risky as the script must have access to highly privileged credentials. To ensure these credentials are not compromised, you can store them with PowerPass in an encrypted locker.
Setup the PowerPass Locker
- First, determine which
logon accountyou plan to use to run the script. - Login to the computer with this account and deploy
PowerPassusing theDeploy-PowerPass.ps1script provided with the release. - Using the
Write-PowerPassSecretcmdlet, write the credentials into the locker using a distinctTitleto recall them later. - Close PowerShell and log off.
For detailed instructions on how to store and retrieve Active Directory Domain credentials with PowerPass, please see the Domain Credentials article. Now that you have credentials in your locker, you can use them in your script.
Update your Script
- Open your script in your favorite PowerShell editor.
- Using the
Read-PowerPassSecretcmdlet, fetch the credentials you stored earlier by selecting with the distinctTitle. - Configure your script to run as the
logon account. - When your script runs it will read the credentials from the encrypted PowerPass Locker.
See below for an example.
Example
This code uses PowerPass to load Domain credentials from the logon account’s PowerPass Locker:
# Get the username and password as a PSCredential
$creds = Read-PowerPassSecret -Match "DEV Domain Admin" -AsCredential
# Call out to Active Directory with the credential
Get-ADUser -Credential $creds
To create the PSCredential, the secret must have a UserName and a Password property set.
If either property is blank, the operation may fail with an error.
All PowerPass topics can be found at the bottom of this page.
All PowerPass Topics
Select one of the links below to browse to another topic.