Closed kchass closed 7 months ago
Thanks for spotting the error in the psPAS documentation - will get that corrected.
For the issue reported with Remove-PASGroup
Can you test outside the module using the below example code?
#after New-PASSession
$ThisSession = Get-PASSession
$GroupID = "2345"
$Method = "DELETE"
$UrlPath = "API/UserGroups/$GroupID/"
$Request = @{
"Method" = $Method
"Uri" = "$($ThisSession.BaseUri)/$UrlPath"
"WebSession" = $ThisSession.WebSession
"ContentType" = "application/json"
}
Invoke-RestMethod @Request
Looking at the API documentation, I think you will see the same issue and error reported https://docs.cyberark.com/PAS/Latest/en/Content/SDK/Users%20Web%20Services%20-%20Delete%20User%20Group.htm
Only deletion of vault groups is mentioned, not directory groups.
@pspete You're right, API doesnt allow deleting directory groups, API error message is not very helpful. poshPACLI works fine to delete such groups, I'll use it for this work. Thanks for quick response. :)
Invoke-RestMethod: {"Details":[{"ErrorCode":"PASWS214E","ErrorMessage":"Can not add a member to directory group [12012].","ParameterName":"groupId"}],"ErrorCode":"PASWS167E","ErrorMessage":"There are some invalid parameters"}
@infamousjoeg is this feature in pipeline via APIs ?
Describe the issue Remove-PASGroup is not working as expected, says some invalid parameters: Cannot add a member to directory group
To Reproduce Steps to reproduce the behavior:
Expected behavior Should be success 200 response, group should be deleted
Screenshots & Console Output![image](https://github.com/pspete/psPAS/assets/111726107/87904b2d-39e5-4c2d-9fd9-0dd7342e8375)
Your Environment Tried in both our PROD and TEST environment
Additional context Help documentation on https://pspas.pspete.dev/commands/Remove-PASGroup might have some typo in example instead of Remove-PASGroup it says Delete-PASGroup -GroupID 3