Skip to content

Instantly share code, notes, and snippets.

@infamousjoeg
Last active September 21, 2017 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save infamousjoeg/28a922b6f1af4cc946097a0cdc4f7e93 to your computer and use it in GitHub Desktop.
Save infamousjoeg/28a922b6f1af4cc946097a0cdc4f7e93 to your computer and use it in GitHub Desktop.
AIM Example
@echo off
REM Declare and set variables
set Admin_ID=Svc_CyberArkREST
set AIM_AppID=AIM-CP-Test
set AIM_Safe=T-APP-CYBR-RESTAPI
REM Make sure the Object Name is the "Name" value of the account stored in EPV
set AIM_Object=Operating System-WinDomain-joe-garcia.local-Svc_CyberArkREST
REM Set AIM CP CLI command to run
set pwdcmd=C:\Progra~2\CyberArk\ApplicationPasswordSdk\CLIPasswordSDK.exe password /p "AppDescs.AppID=%AIM_AppID%" /p "query=Safe=%AIM_Safe%;Folder=Root;object=%AIM_Object%" /o Password
REM For every value returned from pwdcmd set the only value to Admin_PW
for /f %%A in ('%pwdcmd%') do set Admin_PW=%%A
if [%Admin_PW%] ==[] GOTO NOPWD
echo "PWD is %Admin_PW%"
GOTO END
:NOPWD
Echo "Admin password was not fetched"
Exit /B 3
:End
@infamousjoeg
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment