Friday, October 21, 2011

How to assign a computername before OS deployment

During OS deployment in ConfigMgr there are many ways to assign a computername. This can be done automatically or filled in before deployment. How to assign a dynamic computername is described here: How to assign a dynamic computername during OSD. In that post I'm using a script to create a dynamic computername from default BIOS values (assettag, serialnumber).

But what to do when you're using your own format which is not known in BIOS values? Then other ways are available. First there are ConfigMgr/MDT Task Sequence Variables. An overview of these Task Sequence Variables can be found here:

There are also many scripts to find for dynamic computername assignment. More about that on the following TechNet post: "SCCM R2 Unknown Computer Support and changing computer name during Task Sequence"

The one I've used before is the ConfigMgr/MDT method, which asks the computername before deployment (manually) and uses this name during OS deployment. I will describe the steps needed for that here. First created a Non-mandatory advertisement on a OSD collection (in my case created as "Operating System Deployment"). On that specific OSD collection rightclick and choose "Modify Collection Settings".

Under "Collection Variables" tab create a new Variable called "OSDComputerName" and make sure it has no Value. Untick the "Do not display this value in the ConfigMgr console" also.

When choose OK the value will be available beneath "Collection Variables". Now choose OK to finish this configuration setting. Start the computer placed in this collection now and make sure it's non-mandatory. Use F12 for PXE boot indeed.

Once the task sequence is selected it prompts you to input the missing Task Sequence Variable. Watch out not to press Next here, but double click on "OSDComputerName" instead.

Fill in the computername of your choice (in my case HHO-01) and press OK. That way the computername will be saved and used during Operating System Deployment.

When the value is seen in the Task Sequence Wizard press Next. The Task Sequence selected will be running fine then because the missing Task Sequence Variable is known now.

That's all to assign a computername before OS deployment. Again ConfigMgr uses multiple ways to make OS deployment flexible and usable. This great product continues to astonish me with many great opportunities out there.


  1. Hey !

    Good article - I have just written post how to generate computer name dynamically.

    Feedback would be much appreciated


  2. So when I tried this, clicking the "Next" button results in "Failed to run Task Sequence. An error occurred while starting the task sequence (0x80070570)", any ideas?

    1. Just have a look at X:\Windows\Temp\SMSTSlog for the log. It is created as soon as the boot media starts loading the OSD proces.