MDT 2010: Setting the default Computername

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”=

About these ads

About Andrew Barnes

A Scipting and Deployment Specialist.
This entry was posted in MDT 2010 and tagged , , , , , , . Bookmark the permalink.

25 Responses to MDT 2010: Setting the default Computername

  1. Alton Henley says:

    How do I get MDT 2010 to ask what the asset tag is?

    Like this

  2. Craig says:

    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?

    Like this

    • 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.

      Like this

  3. Naveed Anwar says:

    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%

    Like this

  4. Itay says:

    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!

    Like this

  5. Amy says:

    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.

    Like this

    • 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.

      Like this

    • Adam Stranger says:

      Super smart. And if you move your computer you rename it? How do you do asset inventory, by rooms or by asset tag?

      Like this

      • If you have an IP scope per room then this would be easy. I’ve written a post called targeting lite-touch deployments that should help. I’m not a fan of location based naming though. it’s not suitable for today’s mobile workforce.

        Like this

  6. Adam Stranger says:

    I have a naming convention based on Site-%SerialNumber%, it works fine. My problem is that some times a user will go to another site ans have is laptop (XP) plugged in, and get th enext OS schedule which will put him in the site he is deployed from. How can I do this?
    If current host NY-Something OSDComputerName=NY-%SerialNumber%
    also
    If current host NP-Something OSDComputerName=NY-%SerialNumber%
    but
    If current host LA-something new OSDComputerName=LA-%SerialNumber%
    and
    If none of the above applies, make it based on the subnet, which is what I have working now.

    thanks for any help.

    Like this

  7. Natalie says:

    Hey there! I am using an unattended file for my deployments. I have everything working except the auto Computername. We used to take advantage of the directory services tab in WDS. Now, that isn’t working, I am trying to set my Computername field with my unattend file to MC%MAC (which is how we had it set in the directory services tab) and it keeps error-ing out. If I set it to a static name it is fine. Any idea how to do this? Thanks!

    Like this

  8. Lewis says:

    I’m trying to add the computer to the domain and name the computer the same as what I put in the “NAME AND APPROVE” part. Can anyone help? This has been driving me crazy

    Like this

  9. Nall White says:

    Question for you. I was able name the partition via OSDComputerName=%SerialNumber% in the past. I’m now getting this error “Windows could not parse or process the unattended answer file for pass [specialize]. The setting specified in the answer file cannot be applied. The error was detected while processing settings for component [Microsoft-Windows-Shell-Setup].”. This was after updating MDT versions. Under Format and Partition disk task I’ve got OSDComputerName or the partition and the variable at the bottom of the tab and for the variable on the Install Operation System task. When I remove this and put back OSDisk. Everything works. I’m running MDT 2013 and rebuilt everything. Still happening. What am I doing wrong? Oh, and your site helped be learn MDT from scratch. Thanks.

    Like this

  10. Rhys says:

    Hi Andrew,

    I’d like the client PC to prompt the user for the name to be typed in and then join the domain with that name. How would I go about doing this?

    Thankyou

    Like this

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s