Get-VPASSafes


Supported Environments:
SelfHosted
SharedServices
PCloudStandard


Synopsis:

GET CYBERARK SAFES


Description:

USE THIS FUNCTION TO RETRIEVE SAFES BASED ON A SEARCH QUERY


Syntax:

Get-VPASSafes [-searchQuery] <String> [[-IncludeAccounts]] [[-token] <Hashtable>] [<CommonParameters>]


Parameters:

-searchQuery <String>
Search string to find target resource via username, address, safe, platform, etc.
Comma separated for multiple fields, or to search all pass a blank value like so: " "

Required: true
Position: 1
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-IncludeAccounts [<SwitchParameter>]
Switch if to include accounts in the return value or not

Required: false
Position: 2
Default value: False
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-token <Hashtable>
HashTable of data containing various pieces of login information (PVWA, LoginToken, HeaderType, etc).
If -token is not passed, function will use last known hashtable generated by New-VPASToken

Required: false
Position: 3
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug
ErrorAction, ErrorVariable, WarningAction, WarningVariable
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216)


Examples:

$SafesJSON = Get-VPASSafes -searchQuery {SEARCHQUERY VALUE}


Outputs:

If successful:
{
         "count": 2,
         "value": [
                 {
                         "safeNumber": 35,
                         "location": "\\",
                 "creator": "@{id=kjhfkj78-123-kjhf89-9bc1-jhgfd56787; name=vadim@vman.com}",
                         "accounts": "",
                         "olacEnabled": false,
                         "numberOfVersionsRetention": null,
                         "numberOfDaysRetention": 7,
                         "autoPurgeEnabled": false,
                         "creationTime": 1672381453,
                         "lastModificationTime": 1724029246779379,
                         "safeUrlId": "VadimTestSafe",
                         "safeName": "VadimTestSafe",
                         "description": "",
                         "managingCPM": "",
                         "isExpiredMember": false
                 },
                 {
                         "safeNumber": 121,
                         "location": "\\",
                 "creator": "@{id=kjhfkj78-123-kjhf89-9bc1-jhgfd56787; name=vadim@vman.com}",
                         "accounts": " ",
                         "olacEnabled": false,
                         "numberOfVersionsRetention": null,
                         "numberOfDaysRetention": 7,
                         "autoPurgeEnabled": false,
                         "creationTime": 1715299864,
                         "lastModificationTime": 1724029250038895,
                         "safeUrlId": "TestSafe",
                         "safeName": "TestSafe",
                         "description": "",
                         "managingCPM": "",
                         "isExpiredMember": false
                 }
         ]
}

$false if failed