Get-VPASEmptySafes


Supported Environments:
SelfHosted
SharedServices
PCloudStandard


Synopsis:

GET EMPTY SAFES


Description:

USE THIS FUNCTION TO GET ALL THE EMPTY SAFES IN THE ENVIRONMENT


Syntax:

Get-VPASEmptySafes [-ExportToCSV] [-CSVDirectory <String>] [-token <Hashtable>] [<CommonParameters>]

Get-VPASEmptySafes -InputParameters <Hashtable> [-token <Hashtable>] [<CommonParameters>]


Parameters:

-ExportToCSV [<SwitchParameter>]
Output results to a CSV file found in AppData\Local\VPASModuleOutputs directory

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

-CSVDirectory <String>
Output directory where the exported CSV file will be saved to
Default value: C:\Users\{CurrentUser}\AppData\Local\VPASModuleOutputs\ExportedCSVs

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

-InputParameters <Hashtable>
HashTable of values containing the parameters required to make the API call

Required: true
Position: named
Default value:
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: named
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:

$EmptySafes = Get-VPASEmptySafes

$InputParameters = @{
        ExportToCSV = $true|$false
         CSVDirectory = "C:\Temp"
}
$EmptySafes = Get-VPASEmptySafes -InputParameters $InputParameters


Outputs:

If successful:
{
         "value": [
                 ...
                 {
                         "safeNumber": 30,
                         "location": "\\",
                 "creator": "@{id=2; name=Administrator}",
                         "accounts": "",
                         "olacEnabled": false,
                         "numberOfVersionsRetention": null,
                         "numberOfDaysRetention": 7,
                         "autoPurgeEnabled": false,
                         "creationTime": 1722475324,
                         "lastModificationTime": 1736154027369649,
                         "safeUrlId": "Cyberark_Admin",
                         "safeName": "Cyberark_Admin",
                         "description": "",
                         "managingCPM": "",
                         "isExpiredMember": false
                 },
                 {
                         "safeNumber": 32,
                         "location": "\\",
                 "creator": "@{id=2; name=Administrator}",
                         "accounts": "",
                         "olacEnabled": false,
                         "numberOfVersionsRetention": null,
                         "numberOfDaysRetention": 7,
                         "autoPurgeEnabled": false,
                         "creationTime": 1727213248,
                         "lastModificationTime": 1736154027383039,
                         "safeUrlId": "NoCPMSafe",
                         "safeName": "NoCPMSafe",
                         "description": "",
                         "managingCPM": "",
                         "isExpiredMember": false
                 },
                 {
                         "safeNumber": 34,
                         "location": "\\",
                 "creator": "@{id=2; name=Administrator}",
                         "accounts": "",
                         "olacEnabled": false,
                         "numberOfVersionsRetention": null,
                         "numberOfDaysRetention": 7,
                         "autoPurgeEnabled": false,
                         "creationTime": 1727986304,
                         "lastModificationTime": 1736154027395386,
                         "safeUrlId": "delete_after_10_10",
                         "safeName": "delete_after_10_10",
                         "description": "",
                         "managingCPM": "PasswordManager",
                         "isExpiredMember": false
                 },
                 ...
         ]
}

$false if failed