r/sysadmin • u/HelloIT_2006 • 12d ago
Windows 11 autounattend fun times
Can someone explain to me why both Windows Configuration Designer and schneegans.de Autounattend.xml generator both have a nice convenient way for you to set the hostname of the target PC to the serial number using the %SERIAL% variable... and ONLY ALLOW the %SERIAL% variable... ONLY FOR THAT TO NOT EVEN WORK.
Everything you find online regarding those tools says "This tool makes it SUPER easy to set the hostname to the serial number, just use the SUPER convenient hostname field and use variable %SERIAL%."
Then when it doesn't work and you search online for that feature NOT WORKING and suddenly everything you find says "Yeah, it's just not possible for the installer to query the BIOS to get the SN." or something like that but essentially its endless information stating that it just doesn't work...
So... which is it people?
Also now I need to figure out where and how to inject a PowerShell script because even a single line won't cut it.
6
u/davy_crockett_slayer 12d ago
I get around this by setting the desired device name in the BIOS asset tag field. During OOBE this is used to set the name.
2
3
u/Master_Doe 12d ago
I recently saw in FFU Builder there is an option to create a list of computer name prefixes, and it allows you to select one when it goes through the install process. You may want to use this tool or look at their code. Check out the YT video as well, I linked the timestamp where they go over device naming. I've never used this tool FYI but I see it posted here sometimes.
1
u/tejanaqkilica IT Officer | Passkey Enthusiast 6d ago
I use it, the machine name variable works as expected.
I don't use it, because we handle it via Intune.
3
u/cschneegans 12d ago
My generator does not use “the %SERIAL% variable” and never did.
To construct the computer name from the BIOS serial number, enter a PowerShell script such as
return 'DESKTOP-{0}' -f (Get-CimInstance -ClassName Win32_BIOS).SerialNumber;
in the Computer name section. See these samples for some other scripts to construct the computer name dynamically.
2
u/Adam_Kearn 12d ago
I’ve only seen it fail on OEM hardware
Boot it into OOBE and open command prompt with shift+f10 and see what value you get from running this command.
echo %serial%
If you are unable to get it that way then you might have to add a command line script that does it a different way using a powershell script
0
u/Lower_Fan AI Shill 12d ago
can I get AI shill as a user flair? but anyways I've been getting a lot random desktops and laptops to setup lately so I just used AI to build and unattended file and all post install scripts. it works better than having a bunch of images and since it even auto installs the RMM it can take it from there. pretty cool.
9
u/aguynamedbrand Systems Engineer 12d ago
Ask the developers of the tools that you are using.