SCCM OSD Task Sequence: Prompting for Computer Name During Deployment

Alongside automatically generating a computer name during SCCM OSD via MDT, there’s also a more manual approach: prompting the technician for the computer name during the task sequence itself using a pop-up prompt. General Approach Add a “Run PowerShell Script” (or, on older environments, an HTA-based) step early in your task sequence, before the “Apply […]

Prompt For Computer Name During SCCM Osd
Alongside automatically generating a computer name during SCCM OSD via MDT, there’s also a more manual approach: prompting the technician for the computer name during the task sequence itself using a pop-up prompt.

General Approach

  1. Add a “Run PowerShell Script” (or, on older environments, an HTA-based) step early in your task sequence, before the “Apply Windows Settings” step that sets the computer name.
  2. The script should present a simple input dialog, capture the technician’s entered value, and validate it (checking length — remember the 15-character Windows computer name limit — and disallowed characters).
  3. Set the validated value into the OSDComputerName task sequence variable using the Task Sequence COM object: (New-Object -ComObject Microsoft.SMS.TSEnvironment).Value("OSDComputerName") = $enteredName
  4. The subsequent “Apply Windows Settings” step then picks up OSDComputerName automatically, the same way it would if the value had been set any other way (variable, collection, or MDT rules).
Validate the input carefully before setting the variable — an invalid computer name passed through unchecked will cause the “Apply Windows Settings” step to fail later in the sequence, which is a much less helpful place to discover a typo than at the prompt itself.

Where This Still Stands in Configuration Manager (Updated for 2026)

Checking current Configuration Manager documentation confirms nothing has changed here: OSDComputerName is still the correct, documented task sequence variable for this — it’s listed as the input variable the Apply Windows Settings step reads for the destination computer name. The Microsoft.SMS.TSEnvironment COM object is also still the officially documented way to read and write task sequence variables from a script step while the sequence is running. More usefully: Microsoft still hasn’t added a native, built-in “prompt for input” task sequence step. The built-in Apply Windows Settings step only applies a preset value — it doesn’t stop and ask. So a custom Run PowerShell Script step remains the documented, recommended approach for interactive prompting during OSD, exactly as described above. If you set this up a few years ago, there’s no newer built-in feature you’re missing out on by not switching.

Resources

Run PowerShell Script step added early in the SCCM OSD task sequence PowerShell input dialog prompting the technician for the computer name Task Sequence COM object script setting the OSDComputerName variable Apply Windows Settings step using the OSDComputerName variable

Discover more from TechyGeeksHome

Subscribe to get the latest posts sent to your email.

Andrew Armstrong

Andrew Armstrong is a UK-based IT professional with 26+ years of hands-on experience in Windows, Windows Server, SCCM/ConfigMgr, Active Directory, PowerShell, and enterprise infrastructure.

He founded TechyGeeksHome in 2010 and has published over 1,500 practical guides covering real-world IT problems and solutions. When not solving IT problems,

Andrew develops free Windows utilities including Ultimate Settings Panel, which has been downloaded over 850,000 times.