Skip navigation
2230 Views 3 Replies Latest reply: Jun 10, 2011 1:03 PM by EMiranda RSS
Rookie 25 posts since
May 31, 2010

Has received 1 of 9 achievements.
Currently Being Moderated

Jun 9, 2011 5:19 AM

Sysprep - Unknown PC Name Prompt

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

  • EMiranda Expert 681 posts since
    Aug 26, 2009

    Has received 7 of 9 achievements.
    Currently Being Moderated
    1. Jun 10, 2011 12:24 PM (in response to trevor)
    Re: Sysprep - Unknown PC Name Prompt

    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
    
  • JSMCPN Expert 256 posts since
    Jan 17, 2008

    Has received 5 of 9 achievements.
    Currently Being Moderated
    2. Jun 10, 2011 1:01 PM (in response to trevor)
    Re: Sysprep - Unknown PC Name Prompt

    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

    Attachments:
  • EMiranda Expert 681 posts since
    Aug 26, 2009

    Has received 7 of 9 achievements.
    Currently Being Moderated
    3. Jun 10, 2011 1:03 PM (in response to JSMCPN)
    Re: Sysprep - Unknown PC Name Prompt

    Hotels are a good place to script

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 20 points
  • Helpful Answers - 10 points
LANDESK Community powered by Jive SBS® 4.5.7.1  |  Legal Notices  |  Privacy Policy  |  Icon 

TweeterOn Twitter  |  Icon FacebookOn Facebook © 2007 LANDESK Software