Skip to content

Instantly share code, notes, and snippets.

@infamousjoeg
Created February 28, 2023 15:57
Show Gist options
  • Save infamousjoeg/c32f0ea58aee48829afe40302d78cba3 to your computer and use it in GitHub Desktop.
Save infamousjoeg/c32f0ea58aee48829afe40302d78cba3 to your computer and use it in GitHub Desktop.
Export Safe Members for all Safes in CyberArk PAM using psPAS PowerShell Module
# Before running this script, make sure psPAS is installed by running:
# Install-Module psPAS
Import-Module psPAS
$BaseURI = Read-Host "Enter the Base URL (e.g. https://pvwa.example.com)"
$Type = Read-Host "Enter the Authentication Type [cyberark], ldap, radius"
if (!$Type) {
$Type = "cyberark"
}
New-PASSession -BaseURI $BaseURI -Credential $(Get-Credential) -type $Type -concurrentSession $True
Get-PASSafe -extendedDetails $False | ForEach-Object {Get-PASSafeMember -SafeName $_.SafeName} | Export-Csv -Path "SafeMembers.csv" -Force -NoTypeInformation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment