nordlo.partille.cblifecycle 0.5.0
Handles creation, updates and deletion of computer objects representing chromebooks in Active Directory
No packages depend on nordlo.partille.cblifecycle.
Added
Run-ChromebookProvisioning.ps1sends a reminderFAILUREmail while the status staysERROR, once-AlertRepeatHours(default 24, 0 = off) have passed since the last alert; subject readsFAILURE (still failing since <time>). The state file gainsFailingSinceandLastAlertSent. A state file written by an older wrapper with an open, alerted streak gets a reminder on the first failing run after upgrade.Invoke-PKChromebookLifecyclenow reports why each account was queued for deletion: missing from Google data, emptyMatchAttribute(legacy), or deprovisioned past retention. The breakdown appears in event 1202, both run summaries and the new result fieldsDeletionQueued,DeletionSafetyLimitandDeletionBreakdown.- Domain-controller fallback for
Invoke-PKChromebookLifecycleandInvoke-PKChromebookPreprovision: when-Serveris omitted, the PDC emulator is still preferred, but if it is unreachable another available domain controller is used instead of throwing immediately (new private helperResolve-CBDomainController). Run-ChromebookProvisioning.ps1now requires two consecutive failing runs before sending aFAILUREalert mail (was: every OK→ERROR transition). ARECOVEREDmail is only sent if aFAILUREmail was actually sent for the failing streak; a single transient failure that self-recovers on the next run stays silent. Tracked via newConsecutiveFailures/Alertedfields in the state file.- Optional
-PrimaryGroupparameter onInvoke-PKChromebookPreprovisionandInvoke-PKChromebookLifecycle(also surfaced by theRun-ChromebookProvisioning.ps1wrapper) that sets each computer account's AD primary group (primaryGroupID) to a named group instead of the built-in Domain Computers (RID 515). The device is joined to the group first if needed, thenprimaryGroupIDis changed whenever it differs — so the switch applies to both freshly created and existing accounts and is idempotent. Omitting the parameter leaves the primary group unmanaged (accounts are never reverted to Domain Computers). All group-add andprimaryGroupIDwrites stay pinned to the same DC (the PDC emulator by default) so there is no replication race between the two operations. Must be an add-only group (a-MemberOfgroup or-DefaultGroup), never an-OrgUnitGroupMaprule group; a startup warning is logged if it collides with a rule group. (Preprovision events 1156/1157; lifecycle events 1124/1125, plus warning 1126.) - Non-ACTIVE accounts now have their
infoblock and mapped extension attributes refreshed when the source data changes, instead of being only disabled. Previously a deprovisioned/disabled account kept whatever values it had the last time it was ACTIVE — most visibly aninfoblock still readingStatus: ACTIVE. TheDescriptionis deliberately preserved, so a device whoseannotatedUser/OU Google has cleared does not lose its student identity. Extension-attribute updates still skip empty new values, so nothing is blanked. (Event 1110.) - Timed deletion of DEPROVISIONED devices.
Invoke-PKChromebookLifecyclenow records the date a device is first detected as DEPROVISIONED in a configurable AD attribute (-DeprovisionDateAttribute, defaultextensionAttribute1) and, when-EnableDeletionis set, removes the account once it has been deprovisioned for at least-DeprovisionRetentionDaysdays (default 90). Deletions are governed by the existing-DeletionSafetyLimit/-ForceDeletesafeguards. The stamp is cleared automatically if the device returns to ACTIVE. Set-DeprovisionRetentionDays 0to keep the disable+stamp behaviour but never delete. New parameters are also forwarded by theRun-ChromebookProvisioning.ps1wrapper. (Events 1134/1135/1205.) - ACTIVE-wins precedence for duplicate export rows: if a serial appears with both ACTIVE and non-ACTIVE status, the account is created/updated and enabled and is never disabled, deprovision-stamped, or deleted. The conflict is logged (event 1136).
Get-GoogleChromeDevice -HttpTimeoutSec(default 100) sets a per-request timeout on the Google token and Directory API calls so a stalled TCP connection can no longer hang the fetch indefinitely. Retries (MaximumRetryCount) do not cover a hang — they only fire on a completed 429/5xx response. Exposed by theRun-ChromebookProvisioning.ps1wrapper as-GoogleHttpTimeoutSec.- Phase tracking and per-step timing in
Run-ChromebookProvisioning.ps1. The wrapper now logs each phase transition (Startup, ImportModule, GoogleFetch, Preprovision, Lifecycle, Finalize) and, at the end of every run, a timing summary with the elapsed time of each step and the total run time. The current phase is stamped into the lock breadcrumb, so anABNORMAL_ENDalert now names the exact phase (with a descriptive label) the killed run had reached instead of leaving it a mystery.
Changed
- README: the installation section is now a step-by-step guide (prerequisites, module install from the NuGet feed or manually, run-script configuration, syntax check, dry run, scheduled task, verification, upgrade and rollback). Descriptions of the mail flow updated to the two-run rule and daily reminder.
Invoke-PKChromebookPreprovisionno longer performs its two full-OUGet-ADComputerreads when the watch folder is empty. The input-file enumeration now runs first, and both the pre-run index fetch and the post-run count are skipped on a no-file tick. Empty ticks (the common case) drop from minutes to seconds against large OUs; file-processing behaviour is unchanged.- Duplicate-serial warning now reports the exact count and names the specific duplicated serials, and detects two non-ACTIVE rows sharing a serial (the previous count heuristic missed that case).
- Behaviour change: existing
-EnableDeletionusers will begin deleting devices that have been DEPROVISIONED for ≥90 days. Opt out with-DeprovisionRetentionDays 0.
Fixed
RECOVEREDmails reported the time since the previous run (always about 30 minutes) instead of the outage duration; they now measure from the start of the failing streak.- A module import failure now follows the same alerting rules as other
failures (two consecutive runs, then daily reminders) and keeps the state
counters; previously it mailed immediately and reset
ConsecutiveFailures. FAILUREmails triggered by the deletion safety threshold had noERROR DETAILSsection, so the mail did not say what went wrong. The lifecycle pass now adds the block (count, limit, reasons, sample names) toErrorMessages, and the subject readsFAILURE (deletion blocked).- Failed preprovision input files (empty CSV, missing serial column, parse
error) are now added to
ErrorMessageswith the file name and reason; previously the mail only showedFiles failed: 1. Run-ChromebookProvisioning.ps1now adds a generic line naming the cause and the log file toERROR DETAILSwhen a component puts the run inERRORwithout supplying a message (new helperGet-RunErrorDetail).
This package has no dependencies.
| Version | Downloads | Last updated |
|---|---|---|
| 0.5.0 | 2 | 10/14/2026 |
| 0.5.0-rc.4 | 3 | 10/14/2026 |
| 0.5.0-rc.3 | 11 | 08/18/2026 |
| 0.5.0-rc.1 | 12 | 07/01/2026 |
| 0.4.0-rc.3 | 11 | 07/01/2026 |
| 0.4.0-rc.2 | 11 | 07/01/2026 |
| 0.4.0-rc.1 | 11 | 07/01/2026 |
| 0.3.0 | 10 | 06/25/2026 |
| 0.3.0-rc.21 | 10 | 07/01/2026 |
| 0.3.0-rc.20 | 11 | 06/23/2026 |
| 0.3.0-rc.19 | 11 | 06/23/2026 |
| 0.3.0-rc.18 | 10 | 06/22/2026 |
| 0.3.0-rc.17 | 11 | 06/17/2026 |
| 0.3.0-rc.16 | 17 | 06/17/2026 |
| 0.3.0-rc.15 | 12 | 06/17/2026 |
| 0.3.0-rc.14 | 10 | 06/17/2026 |
| 0.3.0-rc.13 | 12 | 06/17/2026 |
| 0.3.0-rc.12 | 12 | 06/17/2026 |
| 0.3.0-rc.11 | 12 | 06/17/2026 |
| 0.3.0-rc.10 | 12 | 06/17/2026 |
| 0.3.0-rc.9 | 11 | 06/16/2026 |
| 0.3.0-rc.8 | 10 | 06/16/2026 |
| 0.3.0-rc.7 | 11 | 06/12/2026 |
| 0.3.0-rc.6 | 17 | 06/09/2026 |