I have a sysprep image that prompts for a computerName, changes the machine name and joins it to the domain, all working well.
However, I would like to grab the machine serial number to set as the computerName. I have found many possibilities from WMI and some VBS scripting which work when I run them on a fully installed machine. However, If I try to use it in a vbs script that runs before joining the domain (specialize stage), the machine reboots during the setup and never completes its sysprep, essentially corrupting the machine.
I am starting to believe that wmi is not totally available during the specialize stage. Just curious, any other methods that people have been successful with?