Last active
September 21, 2017 15:54
-
-
Save infamousjoeg/28a922b6f1af4cc946097a0cdc4f7e93 to your computer and use it in GitHub Desktop.
AIM Example
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
@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 |
Author
infamousjoeg
commented
Sep 21, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment