Using the REST api to reset a privileged account password from the command line.

Document ID : KB000039073
Last Modified Date : 14/02/2018
Show Technical Document Details

Question:  

How to use the REST api to reset a privileged account password from the command line or a script?

 

Answer: 

The most cross platform way of doing this is to use curl. Note that for windows you will have to find and download a version of curl. Curl is free/opensource so there are several ways of getting curl installed. The user will need to determine which is the best way of doing this.

 

curl -u <username>:<password> -H "Content-type: application/xml" -X PUT -d "<Account><Password auto='true'/></Account>" http://<server>:<port>/iam/api/1.0/restapi/environments/ac/endpoints/<endpoint name>/accounts/<account name>

 

You need to replace:

 

<username>:<password> with a user with the authority to log in to use REST and reset the endpoint password, and their password.

<server> = the ENTM server hostname or FQDN

<port> = the ENTM port

<endpoint name> = the name of the endpoint the account resides on

<account name> = the name of the account whose password you are resetting.