none
Set Prompt For Computer Name During OSD Tasksequence RRS feed

  • Question

  • What are the different ways available to prompt & set computer name during OSD. I am aware about setting OSDComputerName as collection variable & vb script package to prompt for computer name. More Interested in other methods natively supported in SCCM 2007/2012 with/without MDT. 

    Prashant Patil


    • Edited by PRASHANT9 Saturday, April 20, 2013 4:23 PM
    Saturday, April 20, 2013 4:18 PM

Answers

  • There is no native way to prompt for that in ConfigMgr. MDT 2012 Update 1 has UDI, which gives you a wizard you can build up with the required fields yourself.

    I myself, uses a home developed HTA (HTML Application), that starts up in the Boot Image (Boot Image Prestart Command), prior to the actual Task Sequence. This is basically just a Webpage on top of a large vbscript, and from here i can choose which type of machine i'm about to the deploy, several options like, input language, applications to include, primary user and so forth. From thoose selections the computername might be auto generated completely or partly, and offcause with sanity checks that it comply with standard computername limitations.

    So to sum up, there is no native way to do this, the computer will get a MININT-XXXXXX name if it is unknown, or if imported prior have the same name as given, when it were imported, unless offcause you set the OSDComputerName variable on the imported computer object.

    You will need to use MDT UDI, VBScript or even PowerShell/.NET (in CM2012 SP1) to accomplish this.


    Best Regards
    Claus Codam
    Consultant, Developer
    Coretech - Blog

    • Proposed as answer by Juke Chou Thursday, April 25, 2013 10:32 AM
    • Marked as answer by Juke Chou Wednesday, May 8, 2013 10:01 AM
    Wednesday, April 24, 2013 1:46 PM

All replies

  • Here is a three line VBS that will prompt for the computername and set the value of the input to the OSDcomputerName.  I like to create a package with no program and only include the vbs.  Then add a task sequence action at the beginning of the TS after "Boot into...."   You will not be able to test this script outside of the TS as the Microsoft.SMS.TSEnvironment object cannot be instantiated.  Keep in mind this is the most simple example I can think of and does not include error checking, etc.

    strComputerName = InputBox("Enter computername") 
    Set env = CreateObject("Microsoft.SMS.TSEnvironment") 
    env("OSDComputerName") = strComputerName

    Sharad Singh | My blogs: SharadTech | Twitter: @SinghSharaad | | Please remember to click “Mark as Answer” on the post that helps you.This can be beneficial to other community members reading the thread.

    • Proposed as answer by SinghSharad Monday, April 22, 2013 4:10 AM
    • Unproposed as answer by PRASHANT9 Tuesday, April 23, 2013 6:57 AM
    Monday, April 22, 2013 4:10 AM
  • As mentioned in my above post, i am aware about vbscript & currently using same. I am more intersted in the other native options available in SCCM with/without MDT. Also above script does not verify given computer name syntax. It accepts any name with illegal characters as well.

    Prashant Patil


    • Edited by PRASHANT9 Tuesday, April 23, 2013 7:36 AM
    Tuesday, April 23, 2013 6:59 AM
  • There is no native way to prompt for that in ConfigMgr. MDT 2012 Update 1 has UDI, which gives you a wizard you can build up with the required fields yourself.

    I myself, uses a home developed HTA (HTML Application), that starts up in the Boot Image (Boot Image Prestart Command), prior to the actual Task Sequence. This is basically just a Webpage on top of a large vbscript, and from here i can choose which type of machine i'm about to the deploy, several options like, input language, applications to include, primary user and so forth. From thoose selections the computername might be auto generated completely or partly, and offcause with sanity checks that it comply with standard computername limitations.

    So to sum up, there is no native way to do this, the computer will get a MININT-XXXXXX name if it is unknown, or if imported prior have the same name as given, when it were imported, unless offcause you set the OSDComputerName variable on the imported computer object.

    You will need to use MDT UDI, VBScript or even PowerShell/.NET (in CM2012 SP1) to accomplish this.


    Best Regards
    Claus Codam
    Consultant, Developer
    Coretech - Blog

    • Proposed as answer by Juke Chou Thursday, April 25, 2013 10:32 AM
    • Marked as answer by Juke Chou Wednesday, May 8, 2013 10:01 AM
    Wednesday, April 24, 2013 1:46 PM
  • The only supported way to modify the computer name during OSD is by modifying the TS variable OSDComputerName.

    Whether you do this through a HTA, VBScript, Collection Task Sequence Variable, Set Task Sequence Variable Action in TS, UDI or any other method is up to you, but with the exception of Collection Task Sequence Variable and Set Task Sequence Variable Action in TS none of the methods are native to SCCM.

    Wednesday, April 24, 2013 4:55 PM
  • I am going to try this and wanted to know if the approach I am going to take is accurate.

    1) Create a .vbs script

    2) Package that script by selecting the option to "no program"

    3) Add the action to the task sequence

    These are the only 3 steps that need to be taken right? By Collection Variables I mean by going to "All Unknown Computers" and adding the OSDComputerName?

    Monday, July 15, 2013 1:16 PM
  • yes correct. you can use either vb script or collection variable.

    advantage of using vb script in the task sequence is that it will only run for that particular task sequence.


    Prashant Patil

    Monday, July 15, 2013 4:52 PM
  • Hello,

    the Vbs Script Worked for me

    strComputerName = InputBox("Enter computername") 
    Set env = CreateObject("Microsoft.SMS.TSEnvironment") 
    env("OSDComputerName") = strComputerName


    El Khiyati

    Tuesday, September 26, 2017 11:39 AM
  • To get computer name and other input variables use SCCM Task Sequence OS Deployment Orchestrator. It's free and enterprise grade. www.sccmtspsi.com

    A Just to mention a few benefits:

    - Detailed email reporting of task sequence deployments.
    - Unlock Bitlocker (Active Directory, remote Active Directory, MBAM, file & key)
    - OnDemand task sequence selection.
    - Operating system selection
    - Office application selection.
    - SCCM application selection.
    - SCCM collection membership in real-time.
    - Active directory group membership.
    - Add Primary system users.
    - Save and restore user data (USMT).
    - 18 extension attribute assignments.
    - Automatic staging.
    - Decommissioning.

    Documentation : https://sccmtspsi.com/documentation/

    Friday, August 9, 2019 3:40 AM