pspete / psPAS

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

Need to pull Account ID passing Name and SafeName #309

Closed jpruitt1 closed 4 years ago

jpruitt1 commented 4 years ago

Describe the issue Many accounts with the same name were 'automatically' named generically with "Misc (9) Platform XYZ' (as an example) and we want to pull the Account ID for these so we can rename them to a meaningful name. We cannot pull by account user name because it is the same account user name in the same safe on many different machines, so we need to pull by the account unique name ("Name") and Safe to get the Account ID. However, when passing the Keyword, Search, or Filter variables, psPAS returns an error indicating ambiguous parameter:

Expected behavior A clear and concise description of what you expected to happen.

Screenshots & Console Output If applicable, add screenshots to help explain your problem.

Console Output Code Block:

Your Environment Include relevant details about your environment

Additional context Add any other context about the problem here.

pspete commented 4 years ago

The command syntax in the first example is not valid; filter & safe \ Keyword do not belong to the same parameterset. Refer to the Get-PASAccount documentation here: https://pspas.pspete.dev/commands/Get-PASAccount Only SafeName is valid for the filter parameter: Get-PASAccount -filter "SafeName eq TargetSafe"

Unless using a CyberArk version earlier than 10.4, the parameterset containing Keywords & Safe should not be used (only 1 result will be returned if a match is found).

Valid syntax for the values included in your issue would be:

Get-PASAccount -safeName LiveLink_App -search Misc-Storage-Only-RR-tuldssdb03-MLLD
pspete commented 4 years ago

Additional note: if no results are returned when searching by name, this is usually because of a setting which is disabled in the CyberArk options.

pspete commented 4 years ago

Hi @jpruitt1 - were you able to solve the ParameterBindingException? Let us know if you still need this issue open or not.

pspete commented 4 years ago

Closing - no response