Link to home
Start Free TrialLog in
Avatar of Drew3517
Drew3517

asked on

Unattended Windows 7 Installation Not Joining Domain

I'm trying to build an image of Windows 7 to roll out across our network, but I'm having problems getting it to join the domain.

I have created an autounatted file (see code below) with Windows AIK and filled in the correct details to join the domain, but after you've run sysprep and the computer reboots, you get the following error message:

The security database on the server does not have a computer account for this workstation trust relationship.

I have looked in AD during the process and I have noticed the following:

-  Windows 7 joins the domain automatically when installed from the CD as Administrator1
-  PC is configured, and sysprep is run. Reboot.
-  As the computer boots up it automatically joins the domain as WIN-VUTDTUTGH2F, then it prompts me to give it a station name (e.g. ACER-04), goes though the rest of the start-up procedure and takes me to the logon screen.
-  The logon screen shows MyDomain, but when I log in I get the above error, and there is no AD entry for ACER-04. Only entries for Administrator1 and WIN-VUTFTUTGH2F

Does anyone know how to get around this?
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <servicing></servicing>
    <settings pass="windowsPE">
        <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SetupUILanguage>
                <UILanguage>en-GB</UILanguage>
            </SetupUILanguage>
            <InputLocale>en-GB</InputLocale>
            <SystemLocale>en-GB</SystemLocale>
            <UILanguage>en-GB</UILanguage>
            <UserLocale>en-GB</UserLocale>
        </component>
        <component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <UserData>
                <AcceptEula>true</AcceptEula>
                <FullName>Company Name</FullName>
                <Organization>Company Name</Organization>
            </UserData>
        </component>
    </settings>
    <settings pass="specialize">
        <component name="Microsoft-Windows-IE-InternetExplorer" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <Home_Page>http://intranet</Home_Page>
            <CompanyName>Company Name</CompanyName>
            <DisableFirstRunWizard>true</DisableFirstRunWizard>
            <DisableWelcomePage>true</DisableWelcomePage>
            <FavoritesOnTop>false</FavoritesOnTop>
        </component>
        <component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <Identification>
                <Credentials>
                    <Password>blahblahblah</Password>
                    <Username>administrator</Username>
                    <Domain>MYDOMAIN</Domain>
                </Credentials>
                <JoinDomain>mydomain.com</JoinDomain>
            </Identification>
        </component>
        <component name="Microsoft-Windows-powercpl" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <PreferredPlan>8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c</PreferredPlan>
        </component>
    </settings>
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Deployment" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <Reseal>
                <Mode>OOBE</Mode>
            </Reseal>
        </component>
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <OOBE>
                <HideEULAPage>true</HideEULAPage>
                <SkipUserOOBE>false</SkipUserOOBE>
                <NetworkLocation>Work</NetworkLocation>
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                <ProtectYourPC>1</ProtectYourPC>
                <SkipMachineOOBE>false</SkipMachineOOBE>
            </OOBE>
            <UserAccounts>
                <AdministratorPassword>
                    <Value>blahblahblah=</Value>
                    <PlainText>false</PlainText>
                </AdministratorPassword>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <Password>
                            <Value>blahblahblah</Value>
                            <PlainText>false</PlainText>
                        </Password>
                        <Description>Drew</Description>
                        <DisplayName>Drew</DisplayName>
                        <Group>Administrators</Group>
                        <Name>Drew</Name>
                    </LocalAccount>
                </LocalAccounts>
            </UserAccounts>
            <ShowWindowsLive>false</ShowWindowsLive>
            <TimeZone>GMT Standard Time</TimeZone>
            <OEMInformation>
                <Manufacturer>Company Name</Manufacturer>
                <Model></Model>
                <SupportHours>9am - 5pm</SupportHours>
                <SupportPhone>3517</SupportPhone>
                <SupportURL>http://it/helpdesk</SupportURL>
                <Logo>C:\Windows\Drew\lg.bmp</Logo>
            </OEMInformation>
            <RegisteredOrganization>Company Name</RegisteredOrganization>
            <RegisteredOwner>Company Name</RegisteredOwner>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="wim://nec-dwalters/esources/install.wim#Windows 7 PROFESSIONAL" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of SaLus
SaLus

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SaLus
SaLus

Forgot to say that the specific tag your looking for is <ComputerName>*</ComputerName>

You could always look into prepping AD for the machine prior to imaging. I have not had the pleasure of trying it that way just yet.
Avatar of Drew3517

ASKER

Thanks for your help!

It's not really what I wanted to hear, but it makes sense. Still seems a bit silly to me though. This works perfectly in XP. I enter the station name on boot, and it joins the domain with that name. I don't know why Microsoft would make Windows 7 join the domain before the station name prompt? Strange!

Don't suppose you could give me some hints on how you made that .exe? I've not done any scripting for a file now. The last thing I made was a .bat file!!
Sure heres everything. Hopefully it helps others as well.

Just a note that this wasn't meant to be distributed and was only meant for my personal use. Sorry for sloppiness and the like. This probably could have been done with a vbscript but I included some other internal options and figure a quick GUI would be in order. I removed those options though :)

Everything should work, let me know if you have any problems:
======================================================
Rename the RenameComputer.log file to RenameComputer.au3 (experts-exchange blocked the file ext)
Download AutoIT as well as the SciTE Script Editor

Simply open the RenameComputer.au3 in SciTE
Edit Line 102 with your proper credentials
Compile (Tools->Compile)

Drop exe in C:\Users\Public\Documents

Edit your Windows7 xml file to add AutoLogon for Local Administrator and set LogonCount to 1. You need administrative priv to rename and activate windows anyway.

Add AsynchronousCommand using Microsoft-Windows-Shell-Setup to OOBE phase
Point CommandLine to C:\Users\Public\Documents\RenameComputer.exe

When the image starts back up and logs in the exe will pop up, fill out the information and hit the set configuration button. Upon successful config it will create and drop a bat file in the C:\Users\Public\Documents which will delete the RenameComputer.exe as well as the bat file itself
RenameComputer.zip
Thanks for all your help, SaLus.

I've not heard of AutoIT before, but it seems like a really useful tool. I think I'll be using that quit a bit!

I managed to make my own script using yours as a guideline, and everything seems to be working just the way I wanted it.

Thanks again!
Drew
I was hoping for a Microsoft way of doing things. Using 3rd party apps is a little messy, but it does the job!