MDT SCCM Prompt for New Computer name deploying Image

Thre are many methods which you can achive this task but i like this way in doing  for prompting the computer name in MDT SCCM when deploying an image would be using the below simple VB script.It deals with known and unknown computers.

set env = CreateObject("Microsoft.SMS.TSEnvironment")

'Set the OSDComputerName variable to the detected name assuming this is a known computer

env("OSDComputerName") = env("_SMSTSMachineName")

'If the detected name contains "MININT" then this is an unknown computer so ask for a name

If InStr(1,env("OSDComputerName"),"MININT",1) then

    Name = inputbox("Rename Computer" ,"Please enter the new Computer name below:",env("OSDComputerName"),400,0)

    env("OSDComputerName") = Name
    env("ComputerName") = Name
    env("HostName") = Name

End If

Copy the script and paste in note pad and save it as .vbs.Add this script to your MDT tool kit package in scripts folder(if you have integrated MDT with SCCM else create a package for this script and a program with command line as cscript VBscript.vbs which have not tried).

Update the DP and make sure,the script should be avilable in  in the DP share.

Now create a new Task  after 'Use Toolkit Package' step in the 'Initialization' phase (group) in your TS with the command line(in mycase it is cscript.exe %deployroot%\scripts\Prompt-CN.vbs).

Below are the simple tasks which can be used to deploy OS:

1. Restart in Windows PE
2. Partition disk
3. Use Toolkit Package
4. Set OSDComputerName
5. Apply Operating System 
8. Apply Windows Settings
9. Apply Network Settings
10. Setup and configure

Below is the sample Task Sequence which you can downlad it from here Win7_X86_Computer Prompt .edit the Task sequence to change the boot image ,Wim Image and other packages as well.

Thanks to Mark for original script.

You can also do this by creating a collection variable called OSDCOmputername to the computer collection and advertise the Task sequence to the collection. More Via Technet and Via windows-noob

3 Responses to "MDT SCCM Prompt for New Computer name deploying Image"

  1. please share powershel script to take computer name based country + suffix Desktop (D), Laptop (L) Virtual VM suffix + 5 digit last serial number


Leave a Reply