SCCM Is an overly complicated tool for what it appears you are trying to do. I personally prefer MDT to create reference images. I also prefer to deploy them that way too since it has built-in tools for domain join and naming using the Unattended.xml file. MDT actually captures a .wim of your machine that is compressed and will deploy faster IMO.
See this link for Sysprep with the unattend file
I have been told that it is possible to run Powershell directly from the Unattend.xml during an OS install. I am trying to set the ComputerName to (A + 'SerialNumber') but not matter how I write the file it keeps being stepped over. I am trying to set the ComputerName to (A + 'SerialNumber') but not matter. I am trying to get the system to rename on first boot after sysprep.
At a previous job about 18 months ago, I was asked to create a single SOE image that worked on many types of hardware, and was customizable to suit one of four organisations depending on which button the user clicked. It was an awesome challenge and I learned a lot from the experience. One of the requirements of this Windows XP image was that the computer name of the machine had to be equal to that of the machine's serial number. That is, the hostname, and domain computer account, had to be exactly what your would yield if you used the WMIC command: C:> WMIC BIOS GET SerialNumber I rememberthat this was quite difficult to achieve, and (for once) Google was of little assistance. There were a few hack 's suggested, like running a script on first start that would pull the value from WMI. But I was after a truely transparent experience which no user could stuff up, and which required no user intervention. I did meet my deliverables on that project, and eighteen months down the track, I am writing this blog entry to you because it just occured to me that I probably should have shared this at the time to hopefully save people some time. Setting the computer name to the machine's serial number in a sysprep build
1. Edit your sysprep.inf file and set the following value:
[UserData] ComputerName=*COMPUTERNAME*
2. Copy and paste (and feel free to re-engineer my poor code) this into a file called GetSerialNumber.wsf <job> <script language='VBScript'> 'Get Serial number from BIOS Set objWMIService = GetObject('winmgmts:impersonationLevel=Impersonate}!.rootcimv2') Set colItems = objWMIService.ExecQuery('Select * from Win32_BIOS',48) FOR EACH item IN colItems compname = item.SerialNumber NEXT 'Edit sysprep.inf file Set objFSO = CreateObject('Scripting.FileSystemObject') Set objFile = objFSO.OpenTextFile('sysprep.inf', 1) strText = objFile.ReadAll objFile.Close strNewText = Replace(strText, '*COMPUTERNAME*', compname) Set objFile = objFSO.OpenTextFile('sysprep.inf', 2) objFile.WriteLine strNewText objFile.Close </script> </job>
3. Create a Winbom.ini file in preparation for a factory-mode sysprep (with mini-setup) 4. Use the [OEMRunOnce] secion to execute the script... The Winbom.ini file will look something *LIKE* this (I lost my copy!.. and CBF testing it):
5. You're done! Now just do a factory mode sysprep. Appologies that this probably wont work out of the box, as I havn't looked at this kind of stuff for 18+ months. I hope it helps. I'm sure this has been achieved by others, but when I needed the method, nobody had documented. I hope I've given you enough info to point you in the right direction. Good luck. P.S. If you see people on the forums having trouble with this, send them my way :D