Get-VPASAccountCompliance


Supported Environments:
SelfHosted
SharedServices
PCloudStandard


Synopsis:

GET ACCOUNT COMPLIANCE STATUS


Description:

USE THIS FUNCTION TO GET THE COMPLIANCE STATUS OF ACCOUNTS IN CYBERARK BASED ON A SEARCH QUERY


Syntax:

Get-VPASAccountCompliance [-safe <String>] [-platform <String>] [-username <String>] [-address <String>] [-ExactMatch] [-ExportToCSV] [-CSVDirectory <String>] [-token <Hashtable>] [<CommonParameters>]

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

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


Parameters:

-safe <String>
Safe name that will be used to query for the target accounts if no AcctID is passed

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

-platform <String>
PlatformID that will be used to query for the target accounts if no AcctID is passed

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

-username <String>
Username that will be used to query for the target accounts if no AcctID is passed

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

-address <String>
Address that will be used to query for the target accounts if no AcctID is passed

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

-AcctID <String>
Unique ID that maps to a single account, passing this variable will skip any query functions

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

-ExactMatch [<SwitchParameter>]
Returns accounts that match search query exactly (not a wildcard search)

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

-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:

$ComplianceStatus = Get-VPASAccountCompliance -safe {SAFE VALUE} -platform {PLATFORM VALUE} -address {ADDRESS VALUE} -username {USRNAME VALUE} -ExactMatch

$ComplianceStatus = Get-VPASAccountCompliance -AcctID {ACCTID VALUE}

$InputParameters = @{
        AcctID = 3_12
         ExportToCSV = $true|$false
         CSVDirectory = "C:\Temp"
}
$ComplianceStatus = Get-VPASAccountCompliance -InputParameters $InputParameters

$InputParameters = @{
        safe = "TargetSafeName"
         platform = "TargetPlatformID"
         username = "TargetUsername"
         address = "TargetAddress"
         ExactMatch = $true|$false
         ExportToCSV = $true|$false
         CSVDirectory = "C:\Temp"
}
$ComplianceStatus = Get-VPASAccountCompliance -InputParameters $InputParameters


Outputs:

If successful:
{
         "value": [
                 ...
                 {
                         "IsCompliant": false,
                         "AccountID": "121_3",
                         "Safe": "TestSafe",
                         "Address": "testdomain.com",
                         "Username": "testdomainuser01",
                         "PlatformID": "WinDomain",
                         "Name": "Operating System-WinDomain-testdomain.com-testdomainuser01",
                         "LastUsedBy": "vman@vman.com",
                         "LastUsedDate": 1716701771
                 },
                 {
                         "IsCompliant": true,
                         "AccountID": "35_215",
                         "Safe": "VadimTestSafe",
                         "Address": "AddressHere",
                         "Username": "UsernameHere",
                         "PlatformID": "WinDomain",
                         "Name": "Operating System-WinDomain-AddressHere-UsernameHere",
                         "LastUsedBy": vman@cyberark.cloud.1234",
                         "LastUsedDate": 1726373536
                 },
                 ...
         ]
}

$false if failed