Set the computer name using the BIOS Asset Tag
If you are setting the Asset Tag the same name that the computer is, it makes sense to only have to input it once. I created a powershell script that will do the following:
If VM or Mac: Exit 0
If computer exists in SCCM: Exit 0
If AssetTag Exists/Not empty: Set OSDComputerName to AssetTag, Exit 0
If AssetTag doesn't exist: Bring up an error message, Exit 1
Tested with HP and Dell machines.
Update: Added optional script that uses the HP Ownership Tag
How to use:
Create a package for the script
Copy serviceUI.exe (From MDT Toolkit) to the same folder.
In the Task Sequence after initial format of the drive create a Run Command Line step using the package that you created
with the command: ServiceUI.exe -process:TSProgressUI.exe %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File AssetTag.ps1
Thanks Nickolaj and Dave Green for the initial form
Okay, I have a problem..
We have over 600 hp laptop/6oo Dell laptops in-house and remote. I created an inventory report and discover hardware with no asset number or wrong asset number. I want script that will allow me to update the asset number, I can't go to each machine and perform this update so I would to see if I can find a script of find some way to use SCCM 2012 to do the update.
Thank You
Michael Spann
Hi Michael,
Anything is possible - If you want it automated first you would need something such as an excel sheet with the correct information. Then use some of Dell's BIOS management tools in a powershell script to correct it.
Hey Jay,
Good work on this!
I used your script as a template and changed it abit:
If $bios is null, then it prompts for a hostname which gets set as OSDComputerName.
This works great, next step I'm adding is using the HP Bios utility to write this to the system. Skips the step of someone manually going to the BIOS to get it done.
Cheers,
Lu
Nice! Blog it!! 🙂
We have had some strange issues on HP's where the script works manually and not in the TS so temporarily disabled ours on HP.
Hope all goes well in your environment