Test-PASDiscoveredLocalAccount

Test-PASDiscoveredLocalAccount

SYNOPSIS

Check discovered account existence

SYNTAX

single

Test-PASDiscoveredLocalAccount -type <String> -subtype <String> -address <String> -username <String>
 -externalId <String> [<CommonParameters>]

multiple

Test-PASDiscoveredLocalAccount -accounts <Hashtable[]> [<CommonParameters>]

DESCRIPTION

Check discovered account existence

EXAMPLES

Example 1

Test-PASDiscoveredLocalAccount -type Windows -subtype Domain -address win-computer.cyber-ark.com -username admin -externalId "user_account_5924"

Checks for the existence of the specified account

Example 2

$accounts = @(
    New-PASDiscoveredAccountObject -type windows -subType loosely -address win-computer.cyber-ark.com -username admin -externalId user_account_5924
    New-PASDiscoveredAccountObject -type mac -subType loosely -address mac-computer.cyber-ark.com -username root -externalId user_account_1132
)
Test-PASDiscoveredLocalAccount -accounts $accounts

Uses New-PASDiscoveredAccountObject to build an array of correctly structured account objects, and checks for the existence of all of them in a single request.

Example 3

[PSCustomObject]@{type='Windows'; subtype='Domain'; address='win-computer.cyber-ark.com'; username='admin'; externalId='user_account_5924'} | Test-PASDiscoveredLocalAccount

Checks for the existence of the specified account, using pipeline input for the account identifier properties.

Example 4

$accounts = @(
    @{ type = 'Windows'; subType = 'Domain'; identifiers = @{ address = 'win-computer.cyber-ark.com'; username = 'admin' }; externalId = 'user_account_5924' }
)
Test-PASDiscoveredLocalAccount -accounts $accounts

Checks for the existence of an account using a manually constructed array of hashtables, matching the raw structure expected by the API instead of using New-PASDiscoveredAccountObject.

PARAMETERS

-type

The account type

Type: String
Parameter Sets: single
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-subtype

The account subtype

Type: String
Parameter Sets: single
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-address

The address identifier of the account

Type: String
Parameter Sets: single
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-username

The username identifier of the account

Type: String
Parameter Sets: single
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-externalId

The external id of the account

Type: String
Parameter Sets: single
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-accounts

a collection of accounts to query.

each account must be a hashtable containing type, subType, identifiers & externalId keys, in the format expected by the API.

New-PASDiscoveredAccountObject can be used to create correctly structured account objects to pass as this parameter’s value.

Type: Hashtable[]
Parameter Sets: multiple
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

https://pspas.pspete.dev/commands/Test-PASDiscoveredLocalAccount

https://pspas.pspete.dev/commands/New-PASDiscoveredAccountObject

https://docs.cyberark.com/identity-protection-space/latest/en/content/discovery/discovery-discoveredaccountsservice-check.htm