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.
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.
Once you are done making the changes, click OK and close the properties window.
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.
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.
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.
If you have any questions, please post it in the comments section.