Remove-PASDependentAccount

Remove-PASDependentAccount

SYNOPSIS

This deletes an existing dependent account.

SYNTAX

Remove-PASDependentAccount [-AccountID] <String> [-dependentAccountId] <String> [-WhatIf] [-Confirm]
 [<CommonParameters>]

DESCRIPTION

Removes the association between a main privileged account and the dependent account.

Requires CyberArk version 14.6 or later.

EXAMPLES

Example 1

Remove-PASDependentAccount -AccountID "123_456" -dependentAccountId "22_2"

Removes the dependent account with ID “789_012” from the main account “123_456”. The system will prompt for confirmation before performing the removal.

Example 2

Get-PASAccount -id "123_456" | Remove-PASDependentAccount -dependentAccountId "22_2" -WhatIf

Shows what would happen if the dependent account were removed, but does not actually perform the removal. Uses pipeline input from Get-PASAccount for the main account ID.

Example 3

Remove-PASDependentAccount -id "123_456" -dependentid "22_2" -Confirm:$false

Removes the dependent account “22_2” from the main account “123_456” without prompting for confirmation, using the -id and -dependentid parameter aliases.

Example 4

@(
    [PSCustomObject]@{ AccountID = '123_456'; dependentAccountId = '22_2' }
    [PSCustomObject]@{ AccountID = '123_456'; dependentAccountId = '22_3' }
) | Remove-PASDependentAccount

Removes multiple dependent accounts from the main account “123_456” in a single pipeline operation, using pipeline input for both -AccountID and -dependentAccountId.

PARAMETERS

-AccountID

The unique ID of the main privileged account that has the dependent account associated with it. This parameter accepts pipeline input and can be aliased as ‘id’.

Type: String
Parameter Sets: (All)
Aliases: id

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

-dependentAccountId

The unique ID of the dependent account that should be removed from the main account association. This parameter accepts pipeline input and can be aliased as ‘dependentid’.

Type: String
Parameter Sets: (All)
Aliases: dependentid

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
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/Remove-PASDependentAccount

https://docs.cyberark.com/pam-self-hosted/latest/en/content/webservices/delete-dependent-account.htm