Easy Way to Prompt Computer name during SCCM OSD

Prajwal Desai
Posted by Prajwal Desai
Prompt Computer name during OSD

You can configure the client to prompt computer name during SCCM OSD without using any scripts. You can set the computer name prompt during OSD using SCCM 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 SCCM 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 SCCM OSD. If you are already using a PowerShell script to achieve this task, this method is actually 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 the name is randomly chosen.

Using the OSDCOMPUTERNAME variable, we will configure the SCCM task sequence and allow the client to prompt computer name during SCCM 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 SCCM OSD
Prompt Computer name during SCCM OSD

Prompt Computer name during SCCM OSD

We will now test if we can successfully prompt computer name during OSD via SCCM task sequence. We will PXE boot a VM and see if we get the computer name prompt during OSD.

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

In the Value box, enter the computer name and click OK.

Prompt Computer name during SCCM OSD
Prompt Computer name during SCCM 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. If you enter more than 15 characters, the task sequence will fail with error code 0x80220005.

Prompt Computer name during SCCM OSD
Prompt Computer name during SCCM OSD

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

OSDCOMPUTERNAME Variable
OSDCOMPUTERNAME Variable
Share This Article
Prajwal Desai
Posted by Prajwal Desai
Follow:
Prajwal Desai is a Microsoft MVP in Intune and SCCM. He writes articles on SCCM, Intune, Windows 365, Windows Server, Windows 11, WordPress and other topics, with the goal of providing people with useful information.
25 Comments