pspete / psPAS

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

Get-PASPSMConnectionParameter #263

Closed olegasdo closed 4 years ago

olegasdo commented 4 years ago

Hello What am I doing wrong when trying to set connection parameters? according documentation it should be "AllowMappingLocalDrives":{"value":"No","ShouldSave":false}, I've tried "No", 0, $false in the follwing table $connectionParams = @{ "AllowMappingLocalDrives" = "No" } And when trying to execute Get-PASPSMConnectionParameter -AccountID $account.id -ConnectionParams $connectionParams -ConnectionComponent PSM-RDP-1440-900 -reason "Fix XYZ"

I'm geting Invoke-PASRestMethod : [400] There are some invalid parameters: Input parameter for [ConnectionParams.AllowMappingLocalDrives] value is invalid

Tried searching for a syntax, but did not managed to find examples.

olegasdo commented 4 years ago

Sorry, never mind. was late did not thought that one should pass another hashtable, not string :)

pspete commented 4 years ago

@olegasdo - if you let me know the command you were able to use, I will add it to the examples & project documentation.

olegasdo commented 4 years ago

Hello Used like this.

[Hashtable]$connectionParams = @{ "AllowMappingLocalDrives" = @{"value"="No";"ShouldSave"=$false} "PSMRemoteMachine" = @{"value"="ServerName";"ShouldSave"=$false} }

Get-PASPSMConnectionParameter -AccountID $account.id -ConnectionParams $connectionParams -ConnectionComponent PSM-RDP -reason "Fix XYZ" -Path .

All possible values from documentation: "ConnectionParams":{ "AllowMappingLocalDrives":{"value":"No","ShouldSave":false}, "AllowConnectToConsole":{"value":"No","ShouldSave":false}, "RedirectSmartCards":{"value":"no","ShouldSave":false}, "PSMRemoteMachine":{"value":"myremotemachine","ShouldSave":false}, "LogonDomain":{"value":"1.1.1.1","ShouldSave":false}, "AllowSelectHTML5":{"value":"No","ShouldSave":false} }

pspete commented 4 years ago

Note the new name & updated parameters for this function introduced in psPAS 4.2

New-PASPSMSession -AccountID <String> [-reason <String>] [-TicketingSystemName <String>] [-TicketId <String>] 
-ConnectionComponent <String> [-AllowMappingLocalDrives<String>] [-AllowConnectToConsole <String>] 
[-RedirectSmartCards <String>] [-PSMRemoteMachine <String>] [-LogonDomain <String>] 
[-AllowSelectHTML5 <String>] [-ConnectionMethod <String>] [-Path <String>] [<CommonParameters>]

Instead of using a hashtable with the ConnectionParams parameter, now the individual connection parameters can be assigned values.