3 Replies Latest reply: Jun 10, 2011 1:03 PM by EMiranda RSS

    Sysprep - Unknown PC Name Prompt

    Rookie

      Hi,

       

      I was wondering if there is a way that when Sysprep is running and the device isn't found in the LDMS DB if Sysprep will prompt for a PC name instead of generating a random name?

       

      Thanks,

       

       

      Matt

        • 1. Re: Sysprep - Unknown PC Name Prompt
          EMiranda Expert

          This was a good question and off the top of my head I couldnt think of a way to do this. I went into my lab and testing some things out and I could not get this to work without using a little scripting.  Here is how I got it to work,

           

           

          Windows XP

           

          advance edit your OSD script

           

          find these two lines:

           

          AUTOCOMPUTERNAME=TEST-nnn
          AUTOCOMPUTERNAMESTARTNUMBER=0

           

          Change the first line to AUTOCOMPUTERNAME=PROMPT

           

          Remove AUTOCOMPUTERNAMESTARTNUMBER=0

           

          Im not sure what AUTOCOMPUTERNAME exactly does, other than use these values to pass into the sysprep file, I just dont know what is doing it

           

          As it is right now, if a LD value is not found then it is going to set a static entry in the sysprep of PROMPT. Unfortunately when I left it blank it would not produce a blank line, so I had to set a static entry so I can search for it with a different script and remove the word.

           

          Compile the below code and add to \\%coreserver%\ldmain\landesk\files

           

          Add these lines after REMEXECxx=ldrun tokreplw C:\sysprep\sysprep.inf COMPUTERNAME=%Computer - Device Name%

           

          REMEXECxx=sdclient /f /o /dest=x:\ldclient\sysprep_prompt.exe /p=http://%CUSTJOBHOSTIP%/landesk/files/sysprep_prompt.exe

          REMEXECxx=ldrun x:\ldclient\sysprep_prompt.exe

           

           

          Now in summary this is what will happen:

           

          • After Image is laid down, LANDesk will modify sysprep.inf with the LANDesk DB value (if it is there)
          • If the LANDesk DB value is not there, it will set the COMPUTERNAME= to a static entry of COMPUTERNAME=PROMPT
          • The script below will read the sysprep.inf for the static entry COMPUTERNAME=PROMPT and replace it with COMPUTERNAME= which will give sysprep the Computer Name prompt.

           

           

          I tried that out and it worked for me on XP, if your on Win7, it will be  more difficult to prompt for Computer name since its sysprep is  extremely different, you did not specify OS, if you need for Win7, I  might have to play around with it some more to find a solution.  Hope  this helps!

           

           

           

          **************************************************************************************************************************************************************************************

           

          Here is the code below to compile sysprep_prompt.exe, if you dont have AutoIT, you can download it here http://www.autoitscript.com/site/autoit/downloads/

           

          AutoIT Code for sysprep_prompt.exe

           

           ;
           ; AutoIt Version: 3.0
           ; Language:       English
           ; Platform:       Win9x/NT
           ; Author:         EMiranda
           ;
           ; Script Function:
           ;   Sysprep Rename Detection
          
          
           #include <File.au3>
          
           $sysprep = "C:\sysprep\sysprep.inf"
           $find = "ComputerName=PROMPT"
           $replace = "ComputerName="
          
          _ReplaceStringInFile($sysprep,$find,$replace,0,0)
           Exit
          
          • 2. Re: Sysprep - Unknown PC Name Prompt
            JSMCPN Expert

            Funny this topic just came up today.  Just two nights ago I wrote this VBScript in my Atlanta hotel room.  It runs under WinPE in WSCRIPT.EXE and looks for C:\Unattend.xml, searches it for %ComputerName% and replaces it with user input.  The script RegEx's the user input to validate and output a usable NetBIOS name.  Enjoy!

             

            Jesse McCoppin - En Pointe Technologies

            • 3. Re: Sysprep - Unknown PC Name Prompt
              EMiranda Expert

              Hotels are a good place to script