nordlo.partille.cblifecycle 0.3.0-rc.6
Handles creation, updates and deletion of computer objects representing chromebooks in Active Directory
No packages depend on nordlo.partille.cblifecycle.
Added
- SPN registration on
Invoke-PKChromebookLifecycle. Every account is ensured to carryhost/<serial>andhost/<serial>.<DnsDomain>onservicePrincipalName. SPNs are written atomically at creation viaNew-ADComputer -OtherAttributesand ensured on existing accounts viaSet-ADComputer -Add(add-only: other SPNs already on the object are left alone). AddsSpnsAddedto the return object andSPN additionsto the run summary. - Event IDs 1140 / 1141 - SPN added to AD account / error adding SPN.
-MatchAttributeparameter onInvoke-PKChromebookLifecycle(defaultextensionAttribute1) - AD attribute holding the Chromebook serial number, used as the identity key for matching and for TameMyCerts certificate-to-account resolution. Validated at startup against the AD schema (must exist and be single-valued) to catch typos.-SamAccountPrefixparameter (defaultCB-) - prefix for the generated SAM name.-Serverparameter - pins all AD operations to a single DC (defaults to the PDC emulator) to avoid replication-delay races between consecutive reads/writes.-OrgUnitGroupMapparameter - hashtable ofregex pattern -> single AD group. Devices whoseorgUnitPathmatches a pattern are added to the associated group; memberships are reconciled (a device is removed from a rule's group once itsorgUnitPathno longer matches). Reconciliation is bounded to groups listed in the map;-MemberOfgroups are still add-only. Conflicts between-MemberOfand-OrgUnitGroupMapthrow at startup. Invalid regex or missing groups also throw at startup.- Disable/re-enable lifecycle driven by CSV
statuscolumn. Non-ACTIVErows (e.g.DEPROVISIONED,DISABLED) disable the matching AD account if it exists; missing AD accounts for non-ACTIVEdevices are not created. Accounts whose CSV status returns toACTIVEare re-enabled. Inactive serials are excluded from the deletion pass (still present in CSV). - Return object fields:
Disabled,Reenabled,InactiveCount. - Event ID 1102 - legacy account detected (no value in
-MatchAttribute), create skipped to avoid duplicates. - Event IDs 1122 / 1123 - account removed from AD group (OU-rule reconcile) / error removing from group.
- Event IDs 1130 / 1131 - AD account disabled (CSV status not
ACTIVE) / error disabling. - Event IDs 1132 / 1133 - AD account re-enabled (CSV status returned to
ACTIVE) / error re-enabling. - README section on registering the Windows Event Log source manually (for scheduled-task service accounts without local admin).
Changed
Invoke-PKChromebookLifecyclenow matches AD accounts via-MatchAttributeinstead of byName/sAMAccountName. New accounts get a randomly generatedsAMAccountNameof the formCB-<11 hex chars>(14 characters), decoupled from the Chromebook serial number — which is now stored in the attribute named by-MatchAttribute. The 15-character NetBIOS limit applies only to the generated SAM name; serial numbers of any length are supported.DNSHostNameis built from<serialNumber>.<DnsDomain>(was<samName>.<DnsDomain>) so Google MDM WiFi profiles authenticate against the correct hostname at NPS/RADIUS. Cert-to-AD matching is unaffected — it still resolves via-MatchAttribute.- CSV gating column changed from
provisionStatus=PROVISIONEDtostatus=ACTIVEto match the actual Google Admin Console export schema. - Account creation is now atomic:
MatchAttributeand all-AttributeMapvalues are written viaNew-ADComputer -OtherAttributes, eliminating the previous create-then-set race that could leave orphan accounts. - Renamed
Get-GoogleChromeDevicestoGet-GoogleChromeDevice(singular noun per PowerShell conventions). File renamed to match.[OutputType]declared. - Upgraded module scaffold (build pipeline, VS Code tasks, PSScriptAnalyzer settings, generic tests) to the latest templates.
- Introduced
GitVersion.ymlfor automated versioning. - Event Log writes use
[System.Diagnostics.EventLog]::WriteEntry(...)instead ofWrite-EventLog(which was removed fromMicrosoft.PowerShell.Managementin PowerShell 7). Removed the now-unusedEventLogNameparameter fromWrite-CbLog.
Fixed
- Log file writes (
Out-FileinWrite-CbLogand the run summary) no longer suppressed by-WhatIf— the audit trail is always written, even in dry runs. Import-Module ActiveDirectoryno longer emits implicit-remoting proxy-copyWhat if:noise under-WhatIf.$WhatIfPreferenceis temporarily cleared around the import (and restored immediately after) so the temporaryremoteIpMoProxy_*file copies don't inherit it. Wrapped intry/catchto surface a clear error if RSAT is missing.
Migration
- TameMyCerts policy must be repointed to
<DirectoryServicesAttribute>extensionAttribute1</DirectoryServicesAttribute>(or the attribute chosen via-MatchAttribute). Coordinated outside this module. - Existing accounts from prior versions are handled by delete-and-recreate, and require two runs because deletion happens after create/update inside a single invocation:
- Run 1 with
-EnableDeletion(add-ForceDeleteif over the safety threshold): legacy accounts trigger event 1102 and are skipped for creation, then removed by the deletion pass. - Run 2: legacy accounts are gone, new
CB-<hex>accounts are created.
- Run 1 with
- Tip: dry-run with
-WhatIf -EnableDeletionfirst to count legacy accounts before deciding on-ForceDelete. - Accounts already on the new
CB-<hex>scheme but with<samName>.<DnsDomain>DNSHostName will be migrated to<serial>.<DnsDomain>in-place on the next run (event 1110 with aDNSHostName: ... -> ...change). Expect a one-shot batch of "updated" accounts.
Known gaps
- No Pester tests covering the new naming behaviour (legacy detection, conflict guard, SAM prefix validation, DNSHostName regen). To follow up in a separate change.
This package has no dependencies.
| Version | Downloads | Last updated |
|---|---|---|
| 0.5.0-rc.1 | 2 | 07/01/2026 |
| 0.4.0-rc.3 | 2 | 07/01/2026 |
| 0.4.0-rc.2 | 1 | 07/01/2026 |
| 0.4.0-rc.1 | 2 | 07/01/2026 |
| 0.3.0 | 1 | 06/25/2026 |
| 0.3.0-rc.21 | 1 | 07/01/2026 |
| 0.3.0-rc.20 | 1 | 06/23/2026 |
| 0.3.0-rc.19 | 1 | 06/23/2026 |
| 0.3.0-rc.18 | 2 | 06/22/2026 |
| 0.3.0-rc.17 | 2 | 06/17/2026 |
| 0.3.0-rc.16 | 8 | 06/17/2026 |
| 0.3.0-rc.15 | 2 | 06/17/2026 |
| 0.3.0-rc.14 | 1 | 06/17/2026 |
| 0.3.0-rc.13 | 2 | 06/17/2026 |
| 0.3.0-rc.12 | 2 | 06/17/2026 |
| 0.3.0-rc.11 | 3 | 06/17/2026 |
| 0.3.0-rc.10 | 2 | 06/17/2026 |
| 0.3.0-rc.9 | 1 | 06/16/2026 |
| 0.3.0-rc.8 | 1 | 06/16/2026 |
| 0.3.0-rc.7 | 2 | 06/12/2026 |
| 0.3.0-rc.6 | 8 | 06/09/2026 |