pspete / psPAS

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

After updating to psPAS v6.03 my script is stopping and asking UseGen1API: #520

Closed winslowohio closed 5 months ago

winslowohio commented 5 months ago

I updated to version 6.03 and now one of my scripts is stopping and asking for input:

Supply values for the following parameters: UseGen1API:

How can I modify my code to avoid this or else what is the input I need to supply?

This is the code where it is stopping to ask for input: Write-Host "INFO: Logging on to the $VaultEnv Vault [$baseURI]..." $token = New-PASSession -Credential (Get-Credential -username $username -Message "Please enter your $VaultENV Vault credentials.rnrnUsername: rnPassword: <NT Password+Token>rnrnNote: Do not include "+"") -BaseURI $baseURI -connectionNumber (Get-Random -Maximum 101 -Minimum 1) -ErrorAction Stop -useRadiusAuthentication $true Write-Output "$(Get-TimeStamp) || INFO || User [$username] is logging in to the $VaultEnv Vault [$baseURI]..." | Out-file $LogFile -Append

Expected behavior The script logs on to the vault and adds the nodes provided to the requested appID and then creates provider accounts and adds the providers to the safe.



**Your Environment**
Include relevant details about your environment

* PowerShell Version: 5.1
* psPAS Version: 6.03
* CyberArk Version: 11.2
winslowohio commented 5 months ago

image

pspete commented 5 months ago

https://pspas.pspete.dev/commands/New-PASSession#gen1radius useRadiusAuthentication is a legacy parameter from the gen1radius parameterset.

either specify UseGen1API $true, or switch to Gen2 API authentication. https://pspas.pspete.dev/commands/New-PASSession#gen2radius

Review the documented examples in the help documentation, most authentication scenarios are covered

pspete commented 5 months ago

based on the old code base your script was written for, there will have been numerous breaking changes over time.

winslowohio commented 5 months ago

We went through and added -UseGen1API as needed. This gets us running for now but will definitely need to rework the scripts to use the current commands and Gen2. Thanks for the assist.