pspete / psPAS

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

Issue in listing Platforms using comand get-PASplatform #246

Closed deepthick4 closed 4 years ago

deepthick4 commented 4 years ago

Describe the issue When trying to pull all the list of platform using get-pasplatform command , i am getting the below issue Invoke-PASRestMethod : [500] The given key was not present in the dictionary. At line:130 char:13

Expected behavior Just to list all active and inactive platform , even filtering to specific platform is not working and returning the same error

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

Console Output Code Block:

Your Environment Include relevant details about your environment Windows 2012 Vault 11.2 HA enabled

Additional context We have two vaults and in one vault this command works fine which got only less platforms . The issue happens on the vault which got more than 400 active platforms

UhtredTheBold commented 4 years ago

Just to add to my colleague's issue, if we run with the platformid switch it will return results fine, but trying to return all platforms or running a search fails with the above error.

pspete commented 4 years ago

See if it works outside of the module:

#after authenticating with New-PASSession
$s = Get-PASSession

$Request = @{
    "Method"      = "GET"
    "Uri"         = "$($s.BaseUri)/API/Platforms"
    "WebSession"  = $s.WebSession
    "ContentType" = "application/json"
}

Invoke-RestMethod @Request

If it works for you when not using the module, I can see what may be the issue in the module's code.

deepthick4 commented 4 years ago

Its not working out the module as well :(

PS C:\Scripts\PAS_Powershell> $Request

Name Value


ContentType application/json Method GET WebSession Microsoft.PowerShell.Commands.WebRequestSession Uri https://pvwa.xxxxxx.xx/PasswordVault/API/Platforms

PS C:\Scripts\PAS_Powershell> Invoke-RestMethod @Request Invoke-RestMethod : {"ErrorCode":"CAWS00001E","ErrorMessage":"The given key was not present in the dictionary."} At line:1 char:1

pspete commented 4 years ago

Unfortunately nothing to update in the module to resolve this. You will need to use your usual support channels.