Skip to content

New-PAMSafe

Harbor OnboardNo sign-in neededGenerated from the codeDescribes Onboard 0.59.0

Creates one CyberArk safe to the Harbor standard: validated name, derived RBAC group membership, managing CPM, UID register entry and audit log.

Terminal window
New-PAMSafe [-SafeType] <string> [[-App] <string>] [[-Technology] <string>] [[-SubType] <string>] [[-AccountType] <string>] [[-Environment] <string>] [[-SamAccountName] <string>] [[-Name] <string>] [[-ExceptionReason] <string>] [[-Description] <string>] [[-Owner] <string>] [[-OwnerUser] <string>] [[-CmdbRef] <string>] [[-TicketRef] <string>] [[-ManagingCpm] <string>] [[-ReserveIds] <string[]>] [[-ExpectedSafeName] <string>] [[-ExpectedUniqueId] <string>] [[-ConfigPath] <string>] [[-ConfigProfile] <string>] [-RetrieveAccounts] [-DryRun] [-SkipGroupCheck] [-NoRollback] [-WhatIf] [-Confirm]

Order of operations (nothing is written until every check passes):

  1. Build + validate the safe name from the segments (all errors at once).
  2. Resolve the RBAC member set for the safe type (group names derived from rbac.groupNaming.pattern; personal safes take -OwnerUser).
  3. Resolve the managing CPM for managed types: -ManagingCpm beats the profile’s defaultManagingCpm beats safe-defaults.json. A managed safe with no CPM is refused – it would never rotate.
  4. Pre-flight against the tenant: the safe must not already exist and every persona/global member must resolve – first as a vault group (memberType Group), then as a CyberArk Identity ROLE (memberType Role; Identity roles are invisible to the vault’s UserGroups API). Fails loudly listing every unresolved name; override with -SkipGroupCheck (members then use rbac.defaultMemberType).
  5. Create the safe, then add each member. If a member add fails the safe is deleted again (partial-create rollback; -NoRollback keeps it).
  6. Append the register entry (UID, owner, CMDB ref) and log the result.

-DryRun produces the full plan (steps 1-3, plus step 4 when a session is connected) without writing anything.

Terminal window
New-PAMSafe -App PAS -Technology SRV -SubType WIN -AccountType DA `
-SafeType shared-managed -Environment P -Owner team@example.com -DryRun
Terminal window
New-PAMSafe -App INV -Technology DB -SubType SQL -AccountType SA `
-SafeType svc-managed -Environment T -RetrieveAccounts -CmdbRef CI-00456
Terminal window
New-PAMSafe -Name 'Legacy Finance Vault' -SafeType shared-unmanaged `
-ExceptionReason 'Pre-migration legacy estate; renaming breaks batch jobs (CHG0041)'

Not described in the module help.

Type Required Position Pipeline input
String No 4 No

Shared / service safes use these 5 segments (required for those types).

Type Required Position Pipeline input
String No 1 No

Not described in the module help.

Type Required Position Pipeline input
String No 12 No

Not described in the module help.

Type Required Position Pipeline input
String No 18 No

Not described in the module help.

Type Required Position Pipeline input
String No 19 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
String No 9 No

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 5 No

Mandatory justification when -Name is used; recorded in the register (who/when/why) and surfaced on reports.

Type Required Position Pipeline input
String No 8 No

Tester C3: the safe name the operator PREVIEWED. A live create whose inputs now build a different name is refused before anything touches the vault.

Type Required Position Pipeline input
String No 16 No

The UID the operator PREVIEWED (the CMDB key they may already have copied). A live create that would issue a different one is refused (409).

Type Required Position Pipeline input
String No 17 No

Not described in the module help.

Type Required Position Pipeline input
String No 14 No

GOVERNED NAMING EXCEPTION: use this raw safe name instead of building one from the segments. Explicit opt-in to bypass the naming standard – requires -ExceptionReason (audited), is mutually exclusive with the segment parameters, and is refused for personal safe types. The name must still be vault-legal (28 chars, no forbidden characters) and the policy guardrails still apply (guardrails outrank exceptions). The safe appears in the Exceptions register on every compliance report.

Type Required Position Pipeline input
String No 7 No

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 10 No

Vault user named as the individual owner member – required for, and only used by, personal safes.

Type Required Position Pipeline input
String No 11 No

UIDs already handed out earlier in a bulk run but not yet in the register (so a multi-row dry-run previews DISTINCT UIDs). Set by Import-PAMSafes.

Type Required Position Pipeline input
String[] No 15 No

Default: @().

Resolves the ‘OPT’ retrieveAccounts permission on managed safe types. Omit it to use the rbac-map default; pass -RetrieveAccounts or -RetrieveAccounts:$false to set it explicitly.

Type Required Position Pipeline input
SwitchParameter No Named No

Not described in the module help.

Type Required Position Pipeline input
String Yes 0 No

Personal safes use this instead (name = I-<CPM location>-<SamAccountName>); the location is derived from the chosen managing CPM.

Type Required Position Pipeline input
String No 6 No

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 3 No

Not described in the module help.

Type Required Position Pipeline input
String No 2 No

Not described in the module help.

Type Required Position Pipeline input
String No 13 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.