locked
Using wsname with sysprep RRS feed

  • Question

  • I'd like to sysprep a computer and have it named as the serial number of the computer and joined to the domain and delete any pre-existing account with the same name if needed.

    WSNAME utility seems to be the easiest way to do this and I found a command on the site that should work:

    wsname /n:$SERIALNUM /rcid /DELETEEXISTING /user:mydomain\administrator /pass:secret

    The problem I have is that I can't find instructions on exactly how to use this in conjunction with Sysprep:

    How must sysprep be setup before using this (full automated? unattended?, password encrypted or not etc.?) and where in the sysprep.inf file does the command go?  I tried adding the command through setupmanger and I don't see any reference to it in the sysprep.ini file.

    I have never seen an example of a sysprep.inf file that does what I want that I can use as a model.

    Does anyone have more info they can provide?  I have already looked at at the website http://mystuff.clarke.co.nz/MyStuff/wsname.asp




    • Edited by MyGposts Tuesday, April 24, 2012 9:28 PM
    Tuesday, April 24, 2012 9:24 PM

All replies

  • Wednesday, April 25, 2012 7:20 AM
  • That blog had some useful info, but it never actually explains exactly how and where to insert the wsname commands either through setup manager or directly editing the sysprep.inf.  Should it be under [GUIRUNONCE] or somewhere else?
    Wednesday, April 25, 2012 4:28 PM
  • Hi,

    yes:

    SYSPREP.INF entry

    [GUIRUNONCE]
    command0="C:\TEMP\Firstboot.cmd"

    ---------------------------------------------------

    Firstboot.cmd

    @echo off
    @echo First Boot
    c:\temp\wsname  /RDF:c:\temp\macaddress.txt /DFK:$MAC /LOGFILE:c:\temp\log\
    reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Runonce" /V runforme /d c:\temp\secondboot.cmd
    c:\temp\shutgui /l /y /t:1 /r (This command reboots the PC after t: number of seconds)

    ---------------------------------------------------

    Secondbood.cmd

    @Echo off
    setlocal
    Echo SecondBoot
    netdom join %computername% /Domain:LABS.PPDI.LOCAL /UserD:domain\username /PasswordD:whatever /REBoot:1"

    ---------------------------------------------------

    http://huckelberry.blogdrive.com/

    Regards,

    Tim



    www.directoryadmin.blogspot.com


    Thursday, April 26, 2012 6:37 AM