Invoke-PAMComplianceScan
The scheduled-cadence compliance scan: runs the compliance report, writes a dated snapshot, diffs against the previous run and alerts on NEW drift only. Connects itself when no session is open (the profile’s declared service account and its declared secret source – zero prompts), so it runs headless from the scheduler as well as interactively.
Syntax
Section titled “Syntax”Invoke-PAMComplianceScan [[-ConfigPath] <string>] [[-ConfigProfile] <string>] [-SkipDrift] [-WithHtml] [-NoNotify]Description
Section titled “Description”The alerting contract is deliberately quiet: a finding that already existed last run is UNCHANGED (no alert, however long it lingers), a finding that disappeared is RESOLVED (reported, never alerted), and only findings appearing for the FIRST time notify the webhook (event ‘compliance-new-drift’). The very first run is a BASELINE: it records the estate and never alerts, so enabling the schedule on a drifted estate does not blast the channel.
Snapshots live in <logPath>\compliance (newest N kept – per-profile compliance.snapshotKeep, default 60) and each embeds its diff, so the run history is self-describing.
G5 auto-remediation (OPT-IN, per-profile compliance.autoRemediate = { “enabled”: true, “maxSafesPerRun”: 5, “dryRun”: false }): after the diff, RBAC-drifted safes are repaired ADDITIVELY (Repair without -RemoveUnexpected: members are added or aligned, never removed), capped per run, never on the baseline and never without the drift audit. What happened is recorded in the result + snapshot (Remediation) and posted as webhook event ‘compliance-auto-remediated’.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”Invoke-PAMComplianceScan -ConfigProfile prodParameters
Section titled “Parameters”-ConfigPath
Section titled “-ConfigPath”Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
String |
No | 0 | No |
-ConfigProfile
Section titled “-ConfigProfile”Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
String |
No | 1 | No |
-NoNotify
Section titled “-NoNotify”Suppress the webhook alert (diff is still computed + stored).
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
-SkipDrift
Section titled “-SkipDrift”Skip the slow member-by-member RBAC drift scan (rogue + registers only).
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
-WithHtml
Section titled “-WithHtml”Also write the branded HTML report next to the snapshot.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
This command also accepts the PowerShell common parameters (-Verbose, -ErrorAction, and so on).
See also
Section titled “See also”- All Harbor Onboard cmdlets
- In PowerShell:
Get-Help Invoke-PAMComplianceScan -Full
Covers Harbor Onboard 0.59.0 / Harbor Health 0.22.0. On an older release? Upgrading and the release notes list what changed.
