General Approach
- 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.
- 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).
- Set the validated value into the
OSDComputerNametask sequence variable using the Task Sequence COM object:(New-Object -ComObject Microsoft.SMS.TSEnvironment).Value("OSDComputerName") = $enteredName - The subsequent “Apply Windows Settings” step then picks up
OSDComputerNameautomatically, the same way it would if the value had been set any other way (variable, collection, or MDT rules).
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
- OSD
- Automatically generate computer name during SCCM OSD
- Configuration Manager
- Browse our Windows Admin Toolkit picks on Amazon
Discover more from TechyGeeksHome
Subscribe to get the latest posts sent to your email.