Most organisations have some sort of PC naming convention in place. Sometimes the human factor can mess it up. Fortunately, MDT can provide semi or full automation as required.
In the customsettings.ini type:
SkipComputerName=NO OSDComputerName=PC_%SerialNumber%
In this example, the SkipComputerName is set to NO so a value can be set and changed during LTI deployment using the wizard pane. Setting the value to YES will hide the computername wizard pane so the value set in OSDComputername will be forced.
The OSDComputername setting contains the name that the computer will be called during the deployment. You are able to use a combination of settings/values. The example above will build the pc (in my case) as PC_G183F7K.
You can use a mixture of variables and ASCII key combinations to construct your computername as your organisation dictates. More variable examples can be found in the variables.dat file, but here are a few that could be useful in computer naming:
“ARCHITECTURE”=X86
“SERIALNUMBER”=G183F7K
“MAKE”=Dell Inc.
“MODEL”=Latitude D610
“PRODUCT”=0M7181
“ASSETTAG”=

How do I get MDT 2010 to ask what the asset tag is?
Use the Property – AssetTag. MDT Collects this information for you. Have a read of my article here – http://wp.me/p1v18I-eD
Is it possible to get MDT to set this on a new machine that you don’t have a variables.dat for? For instance, can you say:
OSDComputerName=PC_%AssetTag%
…and get it to name a brand new machine?
Yes, that’s exactly how it works.
I’m trying to deploy to a mixed physical / VM environment using the serial number for the OSDComputername.
However, on my VMs (VM Ware) the VM serial number is full of spaces. is there a way to stripe out the spaces on the fly?
Hi Craig, the answer is yes, there’s a number of ways to tackle this issue.
Try this line in your customsettings.ini
OSDComputerName=#Mid(Replace(Replace(oEnvironment.Item(“SerialNumber”),” “,”"),”-”,”"),7,15)#
If it looks scary dont be. I’ve written an article for you explaining how I dealt with this issue. I’ll publish it in the morning.
Hi Andrew!
I found your post very helpful, thnaks for sharing!
I have a scenario where I have NOT to use MDT /SCCM just standalone installation with Unattend.xml file … but at the same time I need to have PC name as Serial Number.
OR in other words, I would like to achine the following without MDT /SCCM.
OSDComputerName=PC_%SerialNumber%
Create a vb or powershell script for that mate.
Hi Andrew!,
Nice blog! i have learned a lot from you.
I have one question that I want to ask you, maybe you can assist.
already I have MDT task with zero touch settings that is working and including joining my domain.
I want to be able during the OSD to tell it who is the user (domain user) and that it will set the computer name same as the user that i will provide and also will add that user to the local admin group.
Is this something that is possible?
Thanks!
Hi there,
You should create a custom wizard pane for that, mate.
/Andrew
Junk! I know of no-one who uses serial number for comp name! EVERY org uses PC naming that relates to location, Room17,, PC17. LAB50, PC-50. etc.
Junk? Perhaps you need to get around more. I’ve been in IT for 20 years. I’ve seen asset tags, mac addresses, complex variations including locations, you name it.
My current employer uses MAC addresses and has 450,000 clients worldwide.
Anyway, you’re missing the point, the above is a working example that can be expanded upon.
There is no way to automate a computername using a room number so I think the whole point of ‘Automation’ has gone right above your tiny head.