pspete / psPAS

PowerShell module for CyberArk Privileged Access Security REST API
https://pspas.pspete.dev
MIT License
286 stars 90 forks source link

Retrive all accounts using get-pasaccount #431

Closed nawazsarwar124 closed 1 year ago

nawazsarwar124 commented 1 year ago

Describe the issue I am new to this pspas, i have a safe called Ypsilon where i have 40 accounts and i user the command Get-PASAccount -Safe Ypsilon i get just one result with the following warning:

WARNING: 10 matching accounts found. Only the first result will be returned

I am not able to understand how to see all the accounts in the safe. I am using version 10.10 , i know it's old version but unfortunately client did'nt want to upgrade.

To Reproduce Steps to reproduce the behavior:

  1. Upload the account with different usernames but same address
  2. Get-PASAccount -Safe XXXX

Expected behavior Just want to see all the accounts in the safe. When i search on PVWA i see all the accounts.

Screenshots & Console Output

image


<--Console Output Goes Here-->

Your Environment Version 10.10 I also tried with version 12.0 with same result

Additional context Add any other context about the problem here.

pspete commented 1 year ago

Hi @nawazsarwar124

The behaviour described is due to your Get-PASAccount command targeting the Gen1 API, which will only return the first matching result.

This is documented here: https://pspas.pspete.dev/docs/search/#accounts To return all matching results, avoid the Gen1 parameters Keyword & Safe, and use the default Gen2Query ParameterSet instead: https://pspas.pspete.dev/commands/Get-PASAccount#gen2query-default

E.G.

Get-PASAccount -safeName Ypsilon
nawazsarwar124 commented 1 year ago

Thanks for the reply.

You can proceed to close this issue.