run-enrollment: stop renaming the computer, the PPKG owns it
The package declares <DNSComputerName>F%SERIAL%</DNSComputerName>, so bays are
meant to come up as F<serial>. This script hardcoded a rename to E<serial>,
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.
This commit is contained in:
@@ -27,11 +27,22 @@ if (-not $ppkgFile) {
|
|||||||
}
|
}
|
||||||
Log "Package: $($ppkgFile.Name)"
|
Log "Package: $($ppkgFile.Name)"
|
||||||
|
|
||||||
# --- Set computer name to E<serial> ---
|
# --- Computer name: the PPKG owns it, do NOT rename here ---
|
||||||
$serial = (Get-CimInstance Win32_BIOS).SerialNumber
|
# The package declares <DNSComputerName>F%SERIAL%</DNSComputerName>, so a bay is
|
||||||
$newName = "E$serial"
|
# meant to come up as F<serial>. This script used to run
|
||||||
Log "Setting computer name to $newName"
|
# Rename-Computer -NewName "E$serial"
|
||||||
Rename-Computer -NewName $newName -Force -ErrorAction SilentlyContinue
|
# 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 ---
|
# --- Install provisioning package ---
|
||||||
# IMPORTANT: The PPKG must be installed BEFORE OOBEComplete is set. Bulk
|
# IMPORTANT: The PPKG must be installed BEFORE OOBEComplete is set. Bulk
|
||||||
|
|||||||
Reference in New Issue
Block a user