James Avery
James is a consultant for Catapult Systems and blogs about infrastructure and implementing bleeding-edge hardware and software technology. James holds Microsoft certifications for MDOP, DDPS, SCCM and SCVMM.

Have OS deployment ask for a Computer Name   

Tags: Config Manager/SCCM
Technorati Tags:

I found this on TechNet and had to work through it to make it work. I’ve added pics and better explanations on how to add and deploy the script to work for you. I found the scripts at this URL in TechNet. http://social.technet.microsoft.com/forums/en-US/configmgrosd/thread/5924e840-eb6e-48c1-858f-766a5be625a6/

This script will detect if the current assigned value for the computer name begins with MININT, indicating that this image is bare metal image.  It then prompts the end-user to enter a new computer name.  It is primarily useful for task sequences that do both bare metal and in-place reimages.

Steps to implement the script.

  1. Create a folder for your VBS script called “AskComputerName”.
  2. Copy cscript.exe to the AskComputerName folder.


3. In the folder copy the VBS script to Notepad and save the file as “askcomputername.vbs”


Dim sNewComputerName, oTaskSequence, sTSMachineName
Set oTaskSequence = CreateObject ("Microsoft.SMS.TSEnvironment")
' Get the name the computer is set to receive and truncate to first 6 letters
sTSMachineName = oTAskSequence("_SMSTSMachineName")
sTSMachineName  = lcase(left(sTSMachineName,6))
If sTSMachineName = "minint" Then
    ' The wscript.echo commands are logged in SMSTS.log for troubleshooting.
    ' They are not displayed to the end user.
    wscript.echo "Detected that the computer name is scheduled to receive a random value.  Prompting user to input a standard name."
    sNewComputerName = InputBox ("Please enter a standard computer name.", "Computer Name", , 30,30)
    oTaskSequence("OSDComputerName") = sNewComputerName
    wscript.echo "Set Task Sequence variable OSDComputerName to: " & sNewComputerName
    wscript.echo "Computer set to receive a standard name, continuing as is."
End If


4. Create an SCCM package that holds this script.  Do not create a program. Leave the program blank. Add the package to the appropriate DPs


  5. Edit an existing task sequence or create a new task sequence and add a new task to Run Command Line.  Move it to occur between "Restart in Windows PE" and "Partition Disk"

  6. For the task, give it the name you want.  (e.g. AskComputerName)

  7. Select checkbox "Package" and then select the package created that has the script

  8. In the command line section, put the name of vbscript...with the file extension!

  9. Click OK


  10. When deploying an image, you will see the following box asking for the computer name.


Posted by  James Avery  on  1/23/2009
6  Comments  |  Trackback Url  | 0  Links to this post | Bookmark this post with:        

Links to this post

Trackback from  the best articles  on  4/30/2010  3:06 AM
the best articles 

[...] Hello :) Thx for this information. It�s much appreciated! Best regards super links in <a href="http://www.Ezines.M106.COM">http://www.Ezines.M106.COM</a> Enjoy!. [...]

Trackback from  Chris Nackers  on  7/25/2011  10:46 AM
HTTP 500 Error with Large Reports in SCCM 2007 

[...] Phil Schwan has a new post up talking about how to raise the ... [...]

Pingback from  Scavenge dns | Bandbart  on  3/1/2012  11:52 AM

Pingback from  failed to get client identity, 0×80004005 in SCCM PXE  on  2/15/2013  3:57 PM

Pingback from  How long does SCCM/ConfigMgr site to site replication take?   on  2/15/2013  4:00 PM

Pingback from  HTTP 500 Internal Server Error Running SCCM Reports   on  2/15/2013  4:03 PM

Pingback from  AppV Error 0000c800   on  2/15/2013  4:05 PM

Pingback from  Join a Windows Domain without being on the network  on  2/15/2013  4:10 PM

Pingback from  How long does SCCM Site to Site Replication Take  on  8/29/2013  3:44 AM


Umesh  commented on  Thursday, October 08, 2009  1:29 PM 
Thank you James! nice job..

I have one question: do we need to use separate cscript.exe file for XP and 2003?

Harvey   commented on  Wednesday, March 03, 2010  12:27 PM 
What would prevent the script from hanging? I have it as follows but it does nothing. I tried many other scripts and neither one hangs. I even modified the script to just make it prompt to enter one and it doens't do anything.

James  commented on  Friday, March 05, 2010  9:34 AM 
I've only seen the script hang if the package hasn't been deployed to a distribution point.

Liam  commented on  Thursday, March 25, 2010  3:25 AM 
Thanks this helped alot. I only have 1 suggestion is that to enforce the computer name to be in capitals, just makes things look tidy in my view. I added this line after the input box line:

sNewComputerName = ucase(sComputerName)

Again thanks.

Liam  commented on  Thursday, March 25, 2010  3:27 AM 
Helps if I type out the line correctly!

sNewComputerName = ucase(sNewComputerName)

Mike  commented on  Friday, December 03, 2010  2:17 AM 
Thank you! I've been trying for hours to get this name change to work. Your script is best solution so far! Very handy with standalone media offline installation. Many other guides are only for SCCM collections.

Name *:

CAPTCHA Image Validation