Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-DiscoveredAccountsReport.ps1 - Format-URL errors when using filter options #318

Open
LCM2023 opened this issue Jan 31, 2023 · 3 comments

Comments

@LCM2023
Copy link

LCM2023 commented Jan 31, 2023

When executing the api, it works as long as there's no filtering added. As soon as there's a filter, then the Format-URL error appears

.\Get-DiscoveredAccountsReport.ps1 -PVWAURL https://subdomain.privilegecloud.cyberark.com/passwordvault -List -PlatformType "Windows Server Local" -SearchKeywords "svc" -AutoNextPage -CSVPath "C:\temp\svc_pending.csv"

Error:
There was an Error creating the filter URL. Error: Source:System.Management.Automation; Message: The term 'Format-URL' is not recognized as the name of a cmdlet, function
, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
There was an Error getting filtered Discovered Accounts. Error: Source:System.Management.Automation; Message: Cannot bind argument to parameter 'URI' because it is an empty string.

This should filter the pending safe results to only show accounts that have svc in the name and are of type Windows Local Server however I get the error above. I have tried various filters and all have the same outcome. If I remove the filters, then it runs as expected.

I found 3 references to Format-URL in the api:
$retURL += "search=$(Format-URL $sSearch)&"
$filters += "platformType eq $(Format-URL $sPlatformType)"
$retURL += "sort=$(Format-URL $sSortParam)&"

Any idea why I would be getting that message?

@bab29
Copy link
Collaborator

bab29 commented Mar 17, 2023

Can you please provide the line numbers?

@LCM2023
Copy link
Author

LCM2023 commented Mar 17, 2023

Line 561, 569 and 601. Thanks!

@bab29
Copy link
Collaborator

bab29 commented Oct 24, 2023

Still needs review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants