search cancel

capam_comand escaping problem in cmd

book

Article ID: 253766

calendar_today

Updated On:

Products

CA Privileged Access Manager (PAM)

Issue/Introduction

I'm having an annoying problem with capam_command. I have only a windows machine available (without WSL) and I'm trying to run the command to change the pre-defined password view reasons as stated in the documentation but i get an error

https://techdocs.broadcom.com/us/en/symantec-security-software/identity-security/privileged-access-manager/4-0-1/programming/credential-manager-remote-cli-and-java-api/credential-manager-cli-commands/setpasswordviewreasons.html

Environment

Release : PAM 4.x

Cause

WE have a problem in escaping the pipe | character:

C:\Portable\capam_command>capam_command capam=myserver adminUserID=myuser cmdName=setPasswordViewReasons reasons="System down | Other"
'Other""' is not recognized as an internal or external command,
operable program or batch file.

C:\Portable\capam_command>

I tried every possible escape, like \|, ^|, ^^^|, ^^^|| but without success :-(

 

Resolution

I have reversed engineered the .bat file. I reconstructed the java command with full parameters that is executed and I did execute directly from the command line, without calling tha .bat file

---------

cd C:\MYDIR
set CONFIG_DIR=C:\MYDIR

 

set KEYSTORE_FILENAME=capam.keystore
set CLI_JAR=cliTool.jar
set KEYSTORE=%CONFIG_DIR%\%KEYSTORE_FILENAME%
set LIBS=%CONFIG_DIR%\%CLI_JAR%;.
set SSL_OPTION=-Dcspm.server.install=true -Djavax.net.ssl.trustStore="%KEYSTORE%"
java -cp "%LIBS%" %SSL_OPTION% com.cloakware.cspm.server.ui.CommandLineInterface cspmHostName=MYSERVER adminUserID=MYADMINUSER cmdName=setPasswordViewReasons reasons="Sistema down|Il Sistema è in spegnimento|Consultazione Log|Incident si sicurezza|Verifica anomalia|Altro"

This way it works