Windows 7 Autounattend Example

The following autounattended.xml file can be used to full automate the Windows 7 installation. It will:

  • Create a single partition for the boot, system, crash dump and primary partition
  • Enter the product key
  • Enter the organisation information
  • Configure Internet Explorer 8
    • Disable the information bar
    • Disable the Internet accelerators
    • Disable the developer tools
    • Disable the first run message
    • Set www.google.com.au as the homepage
    • Set Google Australia as the default search provider
  • Set the firewall to option 3 – Work
  • Enable the ‘Administrator’ account
  • Set the ‘Administrator’ password to ‘password’
  • Create a local administrator account called ‘UserName’ with the password of ‘password’
  • Prompt for a computer name (will not prompt for a new user account)

 

Before being able to successfully use this unattended file, you will need to change:

  • Product Key
  • Organisation information
  • local administrator password
  • ‘UserName’ local administrator account name and password

If you’re unfamiliar with how to use an autounattend file:

The autounattend.xml file can be used to automate a single installation of Windows 7 when using DVD media.

When you run your Windows 7 installation it will automatically look for any USB drives containing an autounattend.xml file and apply the settings specified.

To use:

  1. Copy the quoted text into notepad
  2. Edit as required
    1. edit or remove the product key
    2. edit the organisation section
    3. edit the local administrator password as required
    4. edit the ‘UserName’ local administrator account name and password
  3. Save the file as autounattend.xml 
  4. Copy the file to the ROOT (start) of a USB Drive
  5. When you run your Windows 7 installation it will automatically look for any USB drives containing an autounattend.xml file then apply the settings specified.

Autounattend.xml:

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<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">
<ImageInstall>
<OSImage>
<WillShowUI>Never</WillShowUI>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>1</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>
<UserData>
<ProductKey>
<WillShowUI>Never</WillShowUI>
<Key>XXXX-XXXX-XXXX-XXXX-XXXX</Key>
</ProductKey>
<FullName>Information Technology Services</FullName>
<Organization>Organisation Name</Organization>
<AcceptEula>true</AcceptEula>
</UserData>
<DiskConfiguration>
<WillShowUI>Never</WillShowUI>
<Disk>
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
<CreatePartitions>
<CreatePartition>
<Order>1</Order>
<Type>Primary</Type>
<Extend>true</Extend>
</CreatePartition>
</CreatePartitions>
</Disk>
</DiskConfiguration>
</component>
</settings>
<settings pass="specialize">
<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">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Path>net user administrator /active:yes</Path>
<Order>1</Order>
</RunSynchronousCommand>
</RunSynchronous>
</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">
<ShowWindowsLive>false</ShowWindowsLive>
</component>
<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">
<FilterLevel>High</FilterLevel>
<ShowInformationBar>false</ShowInformationBar>
<DisableAccelerators>true</DisableAccelerators>
<DisableDevTools>true</DisableDevTools>
<DisableFirstRunWizard>true</DisableFirstRunWizard>
<DisableOOBAccelerators>true</DisableOOBAccelerators>
<Home_Page>http://www.google.com.au</Home_Page>
<SearchScopes>
<Scope wcm:action="add">
<ScopeDefault>true</ScopeDefault>
<ScopeDisplayName>Google</ScopeDisplayName>
<ScopeKey>SearchProvider1</ScopeKey>
<ScopeUrl>http://www.google.com.au/search?q={searchTerms}</ScopeUrl>
</Scope>
</SearchScopes>
</component>
<component name="Microsoft-Windows-ErrorReportingCore" 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">
<DisableWER>1</DisableWER>
</component>
</settings>
<settings pass="oobeSystem">
<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>
<ProtectYourPC>3</ProtectYourPC>
<NetworkLocation>Work</NetworkLocation>
<SkipMachineOOBE>true</SkipMachineOOBE>
<SkipUserOOBE>false</SkipUserOOBE>
</OOBE>
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>password</Value>
<PlainText>true</PlainText>
</Password>
<Name>UserName</Name>
<Group>Administrators</Group>
</LocalAccount>
</LocalAccounts>
<AdministratorPassword>
<Value>password</Value>
<PlainText>true</PlainText>
</AdministratorPassword>
</UserAccounts>
<TimeZone>Eastern Standard Time</TimeZone>
</component>
</settings>
</unattend>

Tagged in

10 comments on “Windows 7 Autounattend Example

  1. HI Alex,
    You don’t need to use the license key in the file. But you will have to enter it manually on the workstation before the trial expires.
    If you are a medium/large scale company, I recommend you to use KMS service for the windows 7 license activation.

  2. Hi this is very helpful, I am practicing to image a computer and I am building a technician computer, but I don’t want to use a product key in the autounattend.xml, is this possible? If you do a normal install than you can leave the product key blank and you have 30 days to test out the OS

  3. Hey Ruben,

    If you’re using this on a USB stick the following lines will help.

    [u]Instructions: [/u]
    [list][*]Add the ‘component’ part into the ‘specialize’ section!
    [*]Add username, domain, password and domain to join. [/list]

    [b]DOWNLOAD:[/b] [url=http://www.mockbox.net/downloads/unattend_join_domain.xml.txt]join domain for unattend.xml[/url]

    If you’re using ConfigMgr (SCCM) for your OS deployment I suggest you do the join separate from this, I suggest you use the ‘Apply Network Settings’ step in the Task Sequence.

  4. What if i am installing the OS in a virtual machine that is on my ESX.Can i save this xml in any other location other than the USB,like in a floppy drive and mount it to the VM.

Leave a Comment

Your email address will not be published. Required fields are marked *