My unattend.xml file

My unattend.xml file

  • Comments 5

As a tester on Windows 8 I install Windows on my dev machine very frequently.

I use F12 to boot from the network into WinPE, then I run a .bat file which looks something like this:

@echo off
setlocal enabledelayedexpansion

set PASSWORD_ADMIN=(redacted)
set PASSWORD_MATEER=(redacted)
set LICENSE_KEY=(redacted)
set FANCYLANG=qps-plocm

del unattend-processed.xml
for /f "usebackq delims=" %%l in (`type unattend-template.xml`) do (
    set line=%%l
    set line=!line:#PASSWORD_ADMIN#=%PASSWORD_ADMIN%!
    set line=!line:#PASSWORD_MATEER#=%PASSWORD_MATEER%!
    set line=!line:#LICENSE_KEY#=%LICENSE_KEY%!
    set line=!line:#FANCY_LANG#=%FANCY_LANG%!
    echo !line! >> unattend-processed.xml
)

setup.exe /unattend:unattend-processed.xml

This takes my template unattend.xml file, injects various parameters, and calls setup.exe.

The template unattend.xml follows in all of its glory.  We'll take a closer look at some of the things in future posts.

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="windowsPE">
        <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" 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>
                <ProductKey>
                    <WillShowUI>OnError</WillShowUI>
                    <Key>#LICENSE_KEY#</Key>
                </ProductKey>
                <AcceptEula>true</AcceptEula>
                <FullName>Matthew van Eerde</FullName>
                <Organization>Microsoft</Organization>
            </UserData>
            <DiskConfiguration>
                <Disk wcm:action="add">
                    <CreatePartitions>
                        <CreatePartition wcm:action="add">
                            <Order>1</Order>
                            <Extend>true</Extend>
                            <Type>Primary</Type>
                        </CreatePartition>
                    </CreatePartitions>
                    <WillWipeDisk>true</WillWipeDisk>
                    <DiskID>0</DiskID>
                </Disk>
            </DiskConfiguration>
            <ImageInstall>
                <OSImage>
                    <WillShowUI>OnError</WillShowUI>
                    <InstallToAvailablePartition>true</InstallToAvailablePartition>
                </OSImage>
            </ImageInstall>
        </component>
        <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" 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>#FANCY_LANG#</UILanguage>
            </SetupUILanguage>
            <InputLocale>0409:00000409</InputLocale>
            <UserLocale>en-US</UserLocale>
            <SystemLocale>en-US</SystemLocale>
            <UILanguage>#FANCY_LANG#</UILanguage>
        </component>
    </settings>
    <settings pass="specialize">
        <component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="amd64" 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>
                    <Domain>redmond.corp.microsoft.com</Domain>
                    <Password>#PASSWORD_MATEER#</Password>
                    <Username>MatEer</Username>
                </Credentials>
                <JoinDomain>ntdev.corp.microsoft.com</JoinDomain>
            </Identification>
        </component>
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <ComputerName>MATEER-Q</ComputerName>
            <RegisteredOwner>Matthew van Eerde</RegisteredOwner>
            <RegisteredOrganization>Microsoft</RegisteredOrganization>
        </component>
        <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <fDenyTSConnections>false</fDenyTSConnections>
        </component>
        <component name="Networking-MPSSVC-Svc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <FirewallGroups>
                <FirewallGroup wcm:action="add" wcm:keyValue="RemoteDesktop">
                    <Active>true</Active>
                    <Profile>all</Profile>
                    <Group>@FirewallAPI.dll,-28752</Group>
                </FirewallGroup>
            </FirewallGroups>
        </component>
    </settings>
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" 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>
                <NetworkLocation>Work</NetworkLocation>
                <ProtectYourPC>3</ProtectYourPC>
                <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
                <HideLocalAccountScreen>true</HideLocalAccountScreen>
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
            </OOBE>
            <UserAccounts>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <Password>
                            <Value>#PASSWORD_ADMIN#</Value>
                            <PlainText>true</PlainText>
                        </Password>
                        <Name>Admin</Name>
                        <Group>Administrators</Group>
                    </LocalAccount>
                </LocalAccounts>
                <DomainAccounts>
                    <DomainAccountList wcm:action="add">
                        <Domain>redmond.corp.microsoft.com</Domain>
                        <DomainAccount wcm:action="add">
                            <Group>RemoteDesktopUsers</Group>
                            <Name>MatEer</Name>
                        </DomainAccount>
                    </DomainAccountList>
                </DomainAccounts>
            </UserAccounts>
            <TimeZone>Pacific Standard Time</TimeZone>
            <AutoLogon>
                <Password>
                    <Value>#PASSWORD_MATEER#</Value>
                    <PlainText>true</PlainText>
                </Password>
                <Domain>redmond.corp.microsoft.com</Domain>
                <Enabled>true</Enabled>
                <LogonCount>1</LogonCount>
                <Username>MatEer</Username>
            </AutoLogon>
        </component>
    </settings>
</unattend>

 

Leave a Comment
  • Please add 7 and 7 and type the answer here:
  • Post
  • Hi Matthew,

    Great blog post!  I am working to automate the Windows 8 installation for the recent CP release.  I am familiar with the ADK (formally WAIK).

    Is there anyway to bypass the "Settings page" after Windows 8 is installed?

    Similar to your XML file, I had the exact same "Hide" settings already applied during the OOBE.

    Thanks,

    Josh

  • With this unattend.xml file I don't see any part of OOBE at all; the OS installs, I am automatically logged in (once), then I (manually) run another script which installs a bunch of apps.

    When troubleshooting unattend.xml files, I find the setupact.log and setupact.err logs to be very helpful in explaining why a page wasn't hidden when I wanted it to be.

  • Thanks for the quick response!  Upon further investigation it appears that I was missed the following setting:

    <ProtectYourPC>3</ProtectYourPC>

    I originally had this setting in place for Windows 7 so I must have removed it during initial DevPreview testing.

  • Ah, good.

    Bear in mind that most people will want <ProtectYourPC>1</ProtectYourPC> most of the time, rather than >3<

  • Another note: the Windows 8 Consumer Preview ADK is available for download here

    www.microsoft.com/.../details.aspx

Page 1 of 1 (5 items)