How to automatically assign ComputerName during unattended Vista install based on GUID, if it is set in the netbootGUID field on AD?


  • Hello,

    I am doing an unattended install of Vista SP1 via a DVD using an answer file tailored to my needs.

    I prestaged a client computer by creating a Computer object on AD/Windows Server 2008 and also set the pertinent netbootGUID. I prescribed %MACHINENAME% in the answer file for ComputerName. UnsecureJoin is set to false and have enabled Microsoft-Windows-UnattendedJoin > JoinDomain with appropriate credentials.

    But when I run setup off of the DVD, setup generates the following error and quits:
    "windows could not parse or process the unattend answer file for pass [specialize]. The settings specified in the answer file cannnot be applied. The error was detected while processing settings for component [Micrsoft-Windows-Shell-Setup]

    If I specify * for ComputerName, a random machine name is assigned and the computer is added to the appropriate OU.

    What is needed for setup to retrieve the right name off of AD?
    • Moved by Tim QuanModerator Monday, June 29, 2009 3:34 AM (From:Windows Vista Deployment and Imaging)
    Thursday, June 25, 2009 7:22 PM

All replies

  • May be this script can help you

    Option Explicit
    Dim computerName, OU, unattendFile, WshShell, result, fso, unattendFileObject, strContents
    unattendFile = "E:\unattend.xml"

    ' end user defined settings
    Set WshShell = WScript.CreateObject("WScript.Shell")

    dim answer
    do while answer <> vbYes
         computerName = InputBox("Enter the desired computer name", "Computer Name")
         OU = InputBox("Enter the distinguished name of the desired OU", "Organization Unit")
         answer = MsgBox("Is this correct?" & vbCrLf & vbCrLF & "Name: " & computerName & vbCrLF & "OU: " & OU, vbYesNo, "Computer Account Details")

    'WshShell.Run "%SYSTEMDRIVE%\sources\setup.exe /wds /noreboot", 0, true

    Set fso = CreateObject("Scripting.FileSystemObject")

    if fso.FileExists(unattendFile) = false then
         wscript.echo "Couldn't find unattend file"
              'Read the unattend file in and replace apprpriate variables
        Set unattendFileObject = fso.OpenTextFile(unattendFile, 1)
        strContents = unattendFileObject.ReadAll

              strContents = Replace(strContents, "%OU%", OU)
              strContents = Replace(strContents, "%COMPUTERNAME%", computerName)

         'Write the updated contents back to the unattend file
         Set unattendFileObject = fso.OpenTextFile(unattendFile, 2)

    End If

    Regards, Ankur Mishra Sr. Engineer – Systems, Datacenter & Client Deployment Engineering
    Friday, June 26, 2009 1:03 PM
  • Sorry, I didn't post it in the first place. Here it is:

    P.S.: This forum prevented posting the answer file in its entirety owing to the number of charaters.
    • Edited by TRIO IT Support Friday, June 26, 2009 6:53 PM Created hyperlink for the URL
    Friday, June 26, 2009 6:51 PM
  • This link may help:

    Going by the links posted in the aforementioned thread, I am at a dead end to achieve my objective via an unattended DVD install.
    Friday, June 26, 2009 10:13 PM