WELCOME TO BLOG-STACK.NET

A collection of technical solutions from all corners of IT

Homepage

The Application Stack

Posts related to Microsoft software

Latest Posts on Microsoft products

The Networking Stack

All posts related to IP routing and switching

Latest Networking Posts

The Virtualization Stack

VMWare and Hyper-V related posts

info@website.com

+123 456 7890 | +123 456 7890

Automate the Stack!

Everything related to scripting, programming, and making life easier!

View Posts on Automation and Scripting

SCCM OSD Prompt for Computer Name

Here is a script that will prompt you for the computer name during an OSD Task Sequence. This script is far better than manually setting the OSDComputerName variable because it has input validation. Computer names cannot contain special characters or be longer than 15 characters. If you manually set the OSDComputerName variable with the task sequence, you better make sure you type in a valid string. If the string is invalid, you won’t know till later in your task sequence when it tries to apply the invalid computer name and aborts the operation.

By default, the script will grab the serial number from the bios of the computer, prefix it with “KPK-“, then display an input box with this value as the default text. Once you click ‘OK’ it will then validate the computer name to make sure it will be accepted by the OS during the Sysprep step of the “Apply Operating System” phase in the task sequence.
___________________________________________________________________________________________

Here is the VBScript:

___________________________________________________________________________________________

Adding the step in your Task Sequence:

In order for the user to interact with the script, we need to borrow a utility that comes with MDT called “ServiceUI.exe.”

Download and install MDT then navigate to C:\ProgramFiles\Microsoft Deployment Toolkit\Templates\Distribution\Tools\X86 to find ServiceUI.exe

Create a package that contains the .VBS script above along with the ServiceUI.exe program. Then, add a “Run Command Line” to your Task Sequence with the command:

ServiceUI.exe -process:TSProgressUI.exe %SYSTEMROOT%\System32\wscript.exe PromptComputerName.vbs

sccm-compname

 

 

2 thoughts on “SCCM OSD Prompt for Computer Name

  1. I’ve read online that it might be possible to create a vbs script and add it to a Run Command Line in the task sequence to prompt for computer name regardless if its a known or unknown device. Would any of you be familiar with this method?

Leave a Reply

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