Easy Way to Prompt Computer name during SCCM 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

Need Assistance?

Send us a message or post your question in forums.

11 thoughts on “Easy Way to Prompt Computer name during SCCM OSD”

  1. Love your page – There is now an ad every few sentences. Hopefully this is in error and not a new look. Thanks for all the great content.

    Reply
    • Thank you John. About the ads, I know they appear randomly and I have no control over it as Google decides to place the ads. Is it too annoying while reading ?. Let me know.

      Reply
  2. Hi,

    While formatting hp elitebook 840 G7 laptop with external Lancard and its getting formatted.But when iam formatting another new laptop of same model with the same external lancard its not asking for hostname and its taking the same hostname of the previous laptop. With this iam facing the issue of trust relationship. Please can you help on this

    Reply
  3. Thank you for the excellent documentation. Is there a way to automate the creation of the OSDComputerName variable to make the computer name DT-%SerialNumber%, or LT-%SerialNumber%, or VM-%SerialNumber based on the system that is imaging?

    Reply
  4. My question is there a way to have PowerShell prompt the user to change the PC name? I found methods that use SetupUI.exe but none of the scripts changed the hostname.

    Reply
  5. 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!

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

        Reply
        • No
          I am using this for years. if computer is in sccm database (presumably all of your domain computers are) window to set OSDCOMPUTERNAME will be not displayed.
          And if you want to reinstall computer with new name before deploying delete it from the DB

          Reply

Leave a Comment