Last active
August 7, 2018 17:37
-
-
Save secpg/a58cf817c53cd019364229fa58783bcf to your computer and use it in GitHub Desktop.
CyberArk CCP - This script will perform a GET Password call to the CCP using client certificate authentication. The user will be prompted for the certificate PW at runtime.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #### #### | |
| ## ## | |
| # This script will call the CCP using client certificate authentication # | |
| # You will be prompted for the pfx file password # | |
| ## ## | |
| #### #### | |
| # Declare Variables | |
| $BASEURL="___" #example: "https://pvwa.cyberark.com" | |
| $SAFE="___" #CyberArk Safe name | |
| $APPID="___" #CyberArk Application ID | |
| $FOLDER="Root" #CyberArk Safe Folder - Default=Root | |
| $OBJECT="___" #CyberArk object "Name" | |
| $CERTPATH="___" #example: C:\path\to\cert.pfx | |
| # Retrieve Certificate | |
| $CERT=Get-PfxCertificate -FilePath $CERTPATH | |
| # Call the CCP | |
| Invoke-RestMethod -Uri "$BASEURL/AIMWebService/api/Accounts?AppID=$APPID&Safe=$SAFE&Folder=$FOLDER&Object=$OBJECT" -Method Get -CertificateThumbprint $CERT.ThumbPrint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment