In this post I will be showing you how to prompt for the Computer name during task sequence deployment. Without having any logic for the Computer name generation, random system name will be generated starting with MININT and with some other random string.

While applying operating system, there is a variable called OSDCOMPUTERNAME which gets generated automatically while deploying the OS, and we can see its random value under unattend.xml during Apply Operating System step.

Defining Variable OSDCOMPUTERNAME

Incase OSDCOMPUTERNAME value is left blank, task sequence is going to prompt for this value. That’s where we will be using this variable to used as Collection Variables.

Launch SCCM Console and navigate to \Assets and Compliance\Overview\Device Collections, look for collection “All Unknown Computers” as we have targeted our task sequence on this collection.

Prompt for Computer name

Right click All Unknown Computers collection and select Properties.
Under All Unknown Computers Properties, click on Collection Variables tab.

PromptForCompName 02

As you can see there are no variables listed, we are going to create one by clicking on starburst icon.

Provide the name as OSDCOMPUTERNAME, and don’t provide any value. Leave it blank, and click on OK.

PromptForCompName 03

Click on OK to exit the collection properties. That’s it we are ready to deploy the task sequence.

Prompt for Computer name

Run the Task Sequence

Initiate the PXE process or boot media to load boot image. Select the Task Sequence and click on Next.

PromptForCompName 05

As the OSDCOMPUTERNAME variable has been created and left empty, Task Sequence prompts for this variable under Edit Task Sequence Variables.
Before proceeding by click on Next, click on Edit and for testing purpose I am providing value Win10-Prompt.
We are ready to click Next now. If we had proceeded this step without providing variable value to OSDCOMPUTERNAME, it will proceed with default random value ie system name starting MININT- .

PromptForCompName 06

Verify ComputerName

During step Apply Operating System Image step, OSDCOMPUTERNAME variable value will be injected in unattend.xml to generate ComputerName, we can verify this by pressing F8 and navigating to c:\windows\panther\unattend.xml and verify the ComputerName value showing as Win10-Prompt.

PromptForCompName 07