Skip to content

Register-PAMComplianceSchedule

Harbor OnboardNo sign-in neededGenerated from the codeDescribes Onboard 0.59.0

Registers the Windows Task Scheduler job that runs the compliance scan on a cadence: daily at a set time by default, or every N hours. Runs as the CURRENT user without storing a password (S4U logon), so it fires whether or not anyone is signed in.

Terminal window
Register-PAMComplianceSchedule [[-At] <string>] [[-EveryHours] <int>] [[-ConfigProfile] <string>] [[-TaskName] <string>] [-SkipDrift] [-WithHtml] [-WhatIf] [-Confirm]

The task invokes the repo’s Invoke-HarborComplianceScan.ps1 runner with powershell.exe -NonInteractive (a prompt can never hang it). Each run connects with the profile’s DECLARED service account (its serviceAccount block: Set-HarborServiceAccount, or Settings -> Tenant & service account), reading only the declared secret source, as the Windows account the task runs as. So declare a source that account can read with no prompt: ‘dpapi’ stored by that same account, a ‘secretManagement’ vault it can open unattended, or ‘env’ with the variable set in that account’s USER scope (never machine-wide). A ‘prompt’ account cannot run unattended: the task fails fast – check Get-PAMComplianceSchedule.LastResult. Re-running replaces the existing task (idempotent).

Terminal window
Register-PAMComplianceSchedule -ConfigProfile prod
Terminal window
Register-PAMComplianceSchedule -ConfigProfile prod -EveryHours 6 -SkipDrift

Daily run time, 24h ‘HH:mm’ (default 06:30). Ignored when -EveryHours is set.

Type Required Position Pipeline input
String No 0 No

Default: 06:30.

Not described in the module help.

Type Required Position Pipeline input
String No 2 No

Asks for confirmation before the command changes anything.

Type Required Position Pipeline input
SwitchParameter No Named No

Aliases: cf.

Run every N hours instead of daily (1-24). First run starts at the next -At time today/tomorrow, then repeats.

Type Required Position Pipeline input
Int32 No 1 No

Default: 0.

Schedule the quick pass (skip the member-by-member drift scan).

Type Required Position Pipeline input
SwitchParameter No Named No

Not described in the module help.

Type Required Position Pipeline input
String No 3 No

Default: Harbor Compliance Scan.

Shows what the command would do, without doing it.

Type Required Position Pipeline input
SwitchParameter No Named No

Aliases: wi.

Each run also writes the branded HTML report next to its snapshot.

Type Required Position Pipeline input
SwitchParameter No Named No

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.