2

How can one activate Windows 7 deployed via an image through SysPrep using an unattend.xml file?

This is the code I've written so far:

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend"
    xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<settings pass="generalize">
    <component name="Microsoft-Windows-PnpSysprep"
            processorArchitecture="amd64"
            publicKeyToken="31bf3856ad364e35"
            language="neutral" versionScope="nonSxS">
        <PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
    </component>
</settings>
<settings pass="specialize">
    <component name="Microsoft-Windows-Deployment"
            processorArchitecture="amd64"
            publicKeyToken="31bf3856ad364e35"
            language="neutral" versionScope="nonSxS">
        <RunSynchronous>
            <RunSynchronousCommand wcm:action="add">
                <Description>Disable create user account</Description>
                <Path>reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\OOBE /v UnattendCreatedUser /t REG_DWORD /d 1 /f</Path>
                <Order>1</Order>
            </RunSynchronousCommand>
        </RunSynchronous>
    </component>
    <component name="Microsoft-Windows-Shell-Setup"
            processorArchitecture="amd64"
            publicKeyToken="31bf3856ad364e35"
            language="neutral" versionScope="nonSxS">
        <RegisteredOwner>NetLiteracy</RegisteredOwner>
        <RegisteredOrganization>NetLiteracy</RegisteredOrganization>
        <TimeZone>Eastern Standard Time</TimeZone>
    <ProductKey>**ValidProductKey**</ProductKey>
        <Computername>*</Computername>
        <OOBE>
            <HideEULAPage>true</HideEULAPage>
            <NetworkLocation>Other</NetworkLocation>
            <ProtectYourPC>2</ProtectYourPC>
            <SkipUserOOBE>true</SkipUserOOBE>
        </OOBE>
    </component>
</settings>
<settings pass="oobeSystem">
    <component name="Microsoft-Windows-International-Core"
            processorArchitecture="amd64"
            publicKeyToken="31bf3856ad364e35"
            language="neutral" versionScope="nonSxS">
        <InputLocale>en-US</InputLocale>
        <SystemLocale>en-US</SystemLocale>
        <UILanguage>en-US</UILanguage>
        <UserLocale>en-US</UserLocale>
    </component>
</settings>
</unattend>
Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47
AceHigh
  • 23
  • 5
  • why you dont use kms ? in the first boot it would be handled automaticly and you add the generic kms key in the base image – yagmoth555 Jan 29 '15 at 14:19

1 Answers1

3

It sounds as though you're editing the XML for the answer file directly - I would highly recommend that you install Windows Automated Installation Kit (available from Microsoft here) and use the Windows System Image Manager tool therein to edit your answer files using a more user-friendly method, as per the Microsoft Documentation here.

Specifically, you're looking for the value ProductKey in the component amd64_Microsoft-Windows-Shell-Setup_neutral, which should be added in this instance during the specialize phase (phase 4).

BE77Y
  • 2,667
  • 3
  • 18
  • 23