Register-PAMComplianceSchedule
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.
Syntax
Section titled “Syntax”Register-PAMComplianceSchedule [[-At] <string>] [[-EveryHours] <int>] [[-ConfigProfile] <string>] [[-TaskName] <string>] [-SkipDrift] [-WithHtml] [-WhatIf] [-Confirm]Description
Section titled “Description”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).
Examples
Section titled “Examples”Example 1
Section titled “Example 1”Register-PAMComplianceSchedule -ConfigProfile prodExample 2
Section titled “Example 2”Register-PAMComplianceSchedule -ConfigProfile prod -EveryHours 6 -SkipDriftParameters
Section titled “Parameters”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.
-ConfigProfile
Section titled “-ConfigProfile”Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
String |
No | 2 | No |
-Confirm
Section titled “-Confirm”Asks for confirmation before the command changes anything.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
Aliases: cf.
-EveryHours
Section titled “-EveryHours”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.
-SkipDrift
Section titled “-SkipDrift”Schedule the quick pass (skip the member-by-member drift scan).
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
-TaskName
Section titled “-TaskName”Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
String |
No | 3 | No |
Default: Harbor Compliance Scan.
-WhatIf
Section titled “-WhatIf”Shows what the command would do, without doing it.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
Aliases: wi.
-WithHtml
Section titled “-WithHtml”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).
See also
Section titled “See also”- All Harbor Onboard cmdlets
- In PowerShell:
Get-Help Register-PAMComplianceSchedule -Full
Covers Harbor Onboard 0.59.0 / Harbor Health 0.22.0. On an older release? Upgrading and the release notes list what changed.
