Skip to content

Repair-PAMSafePermissions

Harbor OnboardNo sign-in neededGenerated from the codeDescribes Onboard 0.59.0

Remediates RBAC drift on a safe: brings its members + permissions back to the Harbor standard. The fix side of Compare-PAMSafePermissions.

Parameter set One (default):

Terminal window
Repair-PAMSafePermissions [-SafeName] <string> [-RemoveUnexpected] [-DryRun] [-IgnoreMembers <string[]>] [-ConfigPath <string>] [-ConfigProfile <string>] [-WhatIf] [-Confirm]

Parameter set All:

Terminal window
Repair-PAMSafePermissions -All [-RemoveUnexpected] [-DryRun] [-IgnoreMembers <string[]>] [-ConfigPath <string>] [-ConfigProfile <string>] [-WhatIf] [-Confirm]

Runs the same drift analysis as Compare-PAMSafePermissions, then converges the safe to the standard:

  • ADD each expected member that is missing (resolved as a vault group first, then a CyberArk Identity role – the same way New-PAMSafe resolves members), with its standard permission set.
  • UPDATE each member whose permissions drifted, setting the FULL expected set (so missing perms are added and extra perms removed at once).
  • REMOVE members that are present but not part of the standard – ONLY with -RemoveUnexpected (off by default; removal is destructive). The built-in/ignored members and the connecting service user are never touched (same ignore list as Compare-PAMSafePermissions).

‘OPT’ permissions (e.g. retrieveAccounts on managed types) are never changed. Personal safes only reconcile the global admin groups (the individual owner cannot be derived from the name).

-DryRun returns the planned actions without changing anything. Otherwise each safe is gated by ShouldProcess (the web UI passes -Confirm:$false after its own confirm). A session is required – repair reads live membership.

Terminal window
Repair-PAMSafePermissions -SafeName AB-PAS-SRV-WIN-DA-I-M-P -DryRun
Terminal window
Compare-PAMSafePermissions -All | Where-Object { -not $_.InCompliance }
Repair-PAMSafePermissions -All -RemoveUnexpected

Not described in the module help.

Type Required Position Pipeline input
SwitchParameter Yes Named No

Not described in the module help.

Type Required Position Pipeline input
String No Named No

Not described in the module help.

Type Required Position Pipeline input
String No Named No

Asks for confirmation before the command changes anything.

Type Required Position Pipeline input
SwitchParameter No Named No

Aliases: cf.

Not described in the module help.

Type Required Position Pipeline input
SwitchParameter No Named No

Not described in the module help.

Type Required Position Pipeline input
String[] No Named No

Default: @().

Not described in the module help.

Type Required Position Pipeline input
SwitchParameter No Named No

Not described in the module help.

Type Required Position Pipeline input
String Yes 0 No

Shows what the command would do, without doing it.

Type Required Position Pipeline input
SwitchParameter No Named No

Aliases: wi.

This command also accepts the PowerShell common parameters (-Verbose, -ErrorAction, and so on).

Covers Harbor Onboard 0.59.0 / Harbor Health 0.22.0. On an older release? Upgrading and the release notes list what changed.