Skip to main content
Question

psrun2 for domain account

  • March 26, 2025
  • 2 replies
  • 105 views

Hi , 

 

My experience with psrun is hit and miss , I am new in to api tooling and recently I managed to extract passwords for manage accounts password for managed systems.  It worked once and the same command set rejected second time .  Also documentation did not have enough info on domain managed accounts password capability description or mentioned.

does any one have any experience in this area.

 

regards,

Maulik

 

 

 

 

2 replies

  • BeyondTrust Employee
  • March 28, 2025

Hello ​@maulik shah 

psrun2 is a command line tool to simplify API calls. 

You can find our documentation here. 

https://docs.beyondtrust.com/bips/docs/ps-run

Here is one of the common short commands (RetrievePassword) run from a PowerShell prompt.

First you can set your variables.

$HostName = 'pam.company.com'
$api = 'df879f0ca66fdb7d64a4767eaf9198367746e52b2760a71ba6f19b73aa7840944254e53d0287b399d6c993e158d8ba0405034eef3099fea2157be367b3a01218'
$runas = 'apiuser'
$reason = 'MyReason'

$managedSystem = 'targetSystem'
$managedAccount = 'TargetAccount'

Next run your psrun2 command to return password.

 ./psrun2 -i $hostname $api $runas RetrievePassword $managedSystem  $managedAccount $reason

If you are interested in the full Password Safe API please have a look at this KB

https://beyondtrustcorp.service-now.com/csm?id=kb_article_view&sysparm_article=KB0017018

The above kb provides API configuration and sample scripts.

 

If you have any questions please let me know.

Regards,

John

 

 

 


  • Author
  • Trailblazer
  • March 30, 2025

Hi John,

 

Thanks for response it works for static managed system managed account, when managed system is domain i.e xyz.com and account is domain account i have problem running it by name it works with managed system id. 

 

Regards,

Maulik