Domain: Scheduled renewal (SQL / SSRS / PBIRS) · Risk: Changes state · Runs on: Windows, PowerShell 5.1 or 7
When a server is decommissioned or a certificate is handled some other way, this cleanly tears down its renewal job — removing the scheduled task/cron/Agent entry so nothing keeps trying to renew a certificate that no longer matters. It leaves the run log behind as a record of what the job did.
Loads the spec to learn its scheduler backend, removes the schedule entry, and deletes the spec file unless -KeepSpec is given. Best-effort and never throws; returns a descriptor of what was removed.
Recipe 01 — Remove a job entirely
Unregister-SqlCertRenewalJob -JobId sql01-engineRemoves the schedule entry and the spec; the run log is kept.
Recipe 02 — Drop the schedule but keep the spec (to re-schedule later)
Unregister-SqlCertRenewalJob -JobId reports-pbirs -KeepSpecRecipe 03 — A SQL Agent-scheduled job
Unregister-SqlCertRenewalJob -JobId ssrs-portal -SqlInstance RPT01For a SqlAgent job, name the instance hosting the Agent job so the Agent job is removed too.
This undoes a renewal job. It reads the job to find out which scheduler it lives in, removes the scheduled entry there, and deletes the saved job note — unless you say -KeepSpec, which removes only the schedule and leaves the note so you can re-schedule it later. The history of past runs is left in place.
| Question | Answer |
|---|---|
| Outbound calls? | None to the vendor. It removes a local schedule entry (and a SQL Agent job, if that backend). |
| What it changes | Removes the schedule entry; deletes the spec unless -KeepSpec. Leaves the run log. |
| Privileges | Local admin (or Agent rights) to remove the schedule entry. |
| Dependency | Why | Required? |
|---|---|---|
| The job’s spec | To learn which backend to clean up. | Yes |
| The scheduler’s removal tooling | To delete the entry (returns a note if absent). | Yes |
- Removes the automation cleanly, so a decommissioned certificate isn’t quietly re-issued forever.
- Keeps the run log as history — the record of what the job did survives the job’s removal, for audit.
-KeepSpecseparates “stop scheduling” from “forget entirely”, so a pause is distinguishable from a deletion.