From 36be60e9aef70ad8ef768368229ab5d825072383 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Thu, 6 Aug 2026 14:06:58 -0400 Subject: [PATCH] run-enrollment: stop renaming the computer, the PPKG owns it The package declares F%SERIAL%, so bays are meant to come up as F. This script hardcoded a rename to E, which is a second pending rename racing the package's own. Observed on 579C144, 2026-08-06: 13:31:55 run-enrollment Rename-Computer -> E579C144 (pending) 13:32:17 ppkg Reboot/DeviceName -> F%SERIAL% (pending) Provisioning-Diagnostics: "Reboot successfully scheduled. Device name set successfully." 13:36:45 run-enrollment runs AGAIN -> E579C144 (overwrites F) ~13:37 reboot; E579C144 wins Last writer wins at reboot, so the hardcoded prefix silently beat the package. The bay came up E579C144 with the ppkg reporting no errors at all - 535 Provisioning-Diagnostics records, every one of them Level 4. Nothing in this repo ever produced an F name; grep for a prefix rule or a namePrefix setting finds nothing. The convention only works if naming is left to the package, so the rename is removed rather than corrected to F. That also makes it site-agnostic: a different package can name bays differently without a script edit. The double execution is a separate defect and is left alone for now. With the rename gone a second run is harmless: provtool returns 0x800700B7 ERROR_ALREADY_EXISTS and changes nothing. --- playbook/shopfloor-setup/run-enrollment.ps1 | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/playbook/shopfloor-setup/run-enrollment.ps1 b/playbook/shopfloor-setup/run-enrollment.ps1 index b1495f8..de4c1d8 100755 --- a/playbook/shopfloor-setup/run-enrollment.ps1 +++ b/playbook/shopfloor-setup/run-enrollment.ps1 @@ -27,11 +27,22 @@ if (-not $ppkgFile) { } Log "Package: $($ppkgFile.Name)" -# --- Set computer name to E --- -$serial = (Get-CimInstance Win32_BIOS).SerialNumber -$newName = "E$serial" -Log "Setting computer name to $newName" -Rename-Computer -NewName $newName -Force -ErrorAction SilentlyContinue +# --- Computer name: the PPKG owns it, do NOT rename here --- +# The package declares F%SERIAL%, so a bay is +# meant to come up as F. This script used to run +# Rename-Computer -NewName "E$serial" +# which is a second pending rename racing the package's. Observed on 579C144 +# 2026-08-06: +# +# 13:31:55 run-enrollment Rename-Computer -> E579C144 (pending) +# 13:32:17 ppkg Reboot/DeviceName -> F%SERIAL% (pending) +# "Reboot successfully scheduled. Device name set successfully." +# 13:36:45 run-enrollment runs AGAIN -> E579C144 (overwrites F) +# ~13:37 reboot, E579C144 wins +# +# Last writer wins at reboot, so the hardcoded E prefix silently beat the +# package's F. Nothing in this repo ever produced an F name; the convention only +# works if we leave naming to the package. # --- Install provisioning package --- # IMPORTANT: The PPKG must be installed BEFORE OOBEComplete is set. Bulk