SCCM

Easy Way to Prompt Computer name during OSD

You can configure the client to prompt computer name during OSD without using any scripts. Let’s see how to achieve this using a task sequence.

One of the most common requirements during the OS deployment process in SCCM is specifying the computer name. Nobody wants a random computer name assigned to the laptop and expect IT to rename it after imaging.

I know there are several ways to prompt computer name during OSD. You can either use a PowerShell script or use OSD computer name script.

If you are using MDT, you get more options to customize and overall it offers more advantages that a normal task sequence. Not everyone uses MDT in their setup.

However without using any scripts, we can configure our task sequence to prompt computer name during OSD. If you are already using a PowerShell script to achieve this task, this method is actually more simpler.

When you deploy a task sequence, the client computer gets a random name after the imaging is complete. Usually the computer name begins with MININT- and the rest of name is randomly chosen.

Using the OSDCOMPUTERNAME variable we will configure the task sequence and allow the client to prompt computer name during OSD. When you make the changes and deploy the task sequence, you have to enter the computer name.

Define OSDCOMPUTERNAME Variable

First we need to define the OSDCOMPUTERNAME variable before using it. The SCCM task sequence comes with built-in variables and OSDCOMPUTERNAME is one among them.

When the task sequence executes the OSDCOMPUTERNAME variable step, it prompts to enter the computer name. The entered name will be the computer name after the imaging is complete.

You can refer the following Microsoft article for all the Task sequence variables. The computer name variable is actually stored in a task sequence variable called OSDCOMPUTERNAME.

So we define the OSDCOMPUTERNAME variable on a device collection to which the task sequence is deployed. For example, in my case I have a task sequence that is currently deployed to All Unknown computers device collection.

If you have got any other device collection, you must perform the same steps for that collection.

Right click the All Unknown computers device collection and click Properties. Click the Collection Variables tab. Click the Yellow Star icon to define a new variable.

Set OSDCOMPUTERNAME Variable
Set OSDCOMPUTERNAME Variable

On the new variable window, define the variable. Specify the name as OSDCOMPUTERNAME. Ensure Do not display this value in the Configuration Manager console is checked. Do not specify anything for Value and Confirm, just leave it blank. Click OK.

Define OSDCOMPUTERNAME Variable
Define OSDCOMPUTERNAME Variable

Once you are done making the changes, click OK and close the properties window.

Prompt Computer name during OSD
Prompt Computer name during OSD

Prompt Computer name during OSD

We have set the OSDCOMPUTERNAME variable. Now we will PXE boot a VM and see if we get the computer name prompt during OSD.

The task sequence wizard should display the OSDCOMPUTERNAME variable. To specify the computer name you must first click the Edit button.

In the Value box type the computer name and click OK.

Prompt Computer name during OSD
Prompt Computer name during OSD

The next screen confirms the computer name that you just entered. If you wish to change the computer name, click Edit and enter it again. Otherwise click Next.

Note – Windows doesn’t permit computer names that exceed 15 characters. So enter the computer name correctly here.

Prompt Computer name during OSD
Prompt Computer name during OSD

Finally when the imaging is complete, we see the computer name matches the one that we had defined. Congratulations you just learnt how to set computer name during OSD without using any script.

OSDCOMPUTERNAME Variable
OSDCOMPUTERNAME Variable

If you have any questions, please post it in the comments section.

Prajwal Desai

Hi, I am Prajwal Desai. For last few years I have been working on multiple technologies such as SCCM / Configuration Manager, Intune, Azure, Security etc. I created this site so that I can share valuable information with everyone.

Related Articles

4 Comments

  1. Nice article, I think Romain wanted to say that the defualt name for any workstation would be MININT-XXXXX if left blank in the field OSDCOMPUTER NAME. Perhaps he also wanted to point out that the task sequence would continue if you skip (do not enter any vaule in the filed). Is the a way to force entering the computer name vaule and by doing so the task sequence cant continue? BTW I’ve been a huge fan of your work! Keep it up! Cheers from ground shaking Croatia!

      1. He means that if u take a name who already exist in your domain, it will take his place and the old computer wont be able to log on the domain anymore

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button