How To Create An Autounattend Xml File
We have published an extensive series of posts to show how to customize a Windows installation, add software, change settings and then capture that customized Windows in an image suitable for deployment. You can find that series of posts here: Windows 10 Unattended install media
Sometimes, you just need to deploy / install a basic, default Windows 10, with no customizations or pre-installed software. Plain vanilla Windows 10. But, you want to do it without "click this", "choose an option" and similar Windows Setup and OOBE dialogs. Luckily, this is easy with a simple answer file called autounattend.xml added to the root of the install media. In this post, I will give you a sample answer file ready for use. You should edit it to meet your needs. It will run as-is, but it has my name, time zone, and language selection, among other things, in it. This works for me, but probably won't work for you!
Sample answer file (click expand source to show the code):
<?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="windowsPE"> <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>en-GB</UILanguage> </SetupUILanguage> <InputLocale>040b:0000040b</InputLocale> <SystemLocale>en-GB</SystemLocale> <UILanguage>en-GB</UILanguage> <UILanguageFallback>en-US</UILanguageFallback> <UserLocale>en-GB</UserLocale> </component> <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"> <DiskConfiguration> <Disk wcm:action="add"> <CreatePartitions> <CreatePartition wcm:action="add"> <Order>1</Order> <Size>450</Size> <Type>Primary</Type> </CreatePartition> <CreatePartition wcm:action="add"> <Order>2</Order> <Size>100</Size> <Type>EFI</Type> </CreatePartition> <CreatePartition wcm:action="add"> <Order>3</Order> <Size>16</Size> <Type>MSR</Type> </CreatePartition> <CreatePartition wcm:action="add"> <Extend>true</Extend> <Order>4</Order> <Type>Primary</Type> </CreatePartition> </CreatePartitions> <ModifyPartitions> <ModifyPartition wcm:action="add"> <Format>NTFS</Format> <Label>WinRE</Label> <Order>1</Order> <PartitionID>1</PartitionID> <TypeID>DE94BBA4-06D1-4D40-A16A-BFD50179D6AC</TypeID> </ModifyPartition> <ModifyPartition wcm:action="add"> <Format>FAT32</Format> <Label>System</Label> <Order>2</Order> <PartitionID>2</PartitionID> </ModifyPartition> <ModifyPartition wcm:action="add"> <Order>3</Order> <PartitionID>3</PartitionID> </ModifyPartition> <ModifyPartition wcm:action="add"> <Format>NTFS</Format> <Label>Windows</Label> <Letter>C</Letter> <Order>4</Order> <PartitionID>4</PartitionID> </ModifyPartition> </ModifyPartitions> <DiskID>0</DiskID> <WillWipeDisk>true</WillWipeDisk> </Disk> </DiskConfiguration> <UserData> <ProductKey> <Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key> </ProductKey> <AcceptEula>true</AcceptEula> <Organization>Win10.guru</Organization> </UserData> <ImageInstall> <OSImage> <InstallTo> <DiskID>0</DiskID> <PartitionID>4</PartitionID> </InstallTo> </OSImage> </ImageInstall> </component> </settings> <settings pass="oobeSystem"> <component name="Microsoft-Windows-International-Core" 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"> <InputLocale>040b:0000040b</InputLocale> <SystemLocale>EN-GB</SystemLocale> <UILanguage>EN-GB</UILanguage> <UILanguageFallback>EN-GB</UILanguageFallback> <UserLocale>EN-GB</UserLocale> </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"> <OOBE> <VMModeOptimizations> <SkipAdministratorProfileRemoval>false</SkipAdministratorProfileRemoval> </VMModeOptimizations> <HideEULAPage>true</HideEULAPage> <HideLocalAccountScreen>true</HideLocalAccountScreen> <HideOnlineAccountScreens>true</HideOnlineAccountScreens> <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> <ProtectYourPC>1</ProtectYourPC> <UnattendEnableRetailDemo>false</UnattendEnableRetailDemo> </OOBE> <UserAccounts> <LocalAccounts> <LocalAccount wcm:action="add"> <Description>Local admin account</Description> <DisplayName>Admin</DisplayName> <Group>Administrators</Group> <Name>Admin</Name> </LocalAccount> </LocalAccounts> </UserAccounts> <RegisteredOrganization>Win10.guru</RegisteredOrganization> <RegisteredOwner>Kari</RegisteredOwner> <TimeZone>W. Europe Standard Time</TimeZone> </component> </settings> <settings pass="specialize"> <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"> <OEMInformation> <Manufacturer>Win10.guru</Manufacturer> <Model></Model> <SupportHours>24/7</SupportHours> <SupportPhone>+44 123 4567890</SupportPhone> <SupportProvider>Win10.guru</SupportProvider> <SupportURL>https://win10.guru</SupportURL> </OEMInformation> <ComputerName>*</ComputerName> <CopyProfile>true</CopyProfile> <OEMName>Win10.guru</OEMName> <RegisteredOrganization>Win10.guru</RegisteredOrganization> <RegisteredOwner>Kari</RegisteredOwner> <TimeZone>W. Europe Standard time</TimeZone> </component> </settings> </unattend>
This answer file is my personal one, what I use. You need to edit it to meet your needs. You can download the sample file from my OneDrive.
Let's look at what you need to edit. First, Processor Architecture. In all COMPONENT tags (5 in this answer file), you'll find setting processorArchitecture="amd64". That means that OS being installed is 64 bit. If installing a 32 bit Windows, change all those five instances to processorArchitecture="x86":
<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">
Next, locales. They appear twice, in component Microsoft-Windows-International-Core-WinPE and in component Microsoft-Windows-International-Core. Two quite similar named components, with totally different purpose. The first one tells Windows Setup the OS language and language for system accounts like the build-in admin, the second one sets up the locales for end users:
<SetupUILanguage> <UILanguage>en-GB</UILanguage> </SetupUILanguage> <InputLocale>040b:0000040b</InputLocale> <SystemLocale>en-GB</SystemLocale> <UILanguage>en-GB</UILanguage> <UILanguageFallback>en-US</UILanguageFallback> <UserLocale>en-GB</UserLocale>
– UILanguage = Which language version of Windows will be installed
– InputLocale = default keyboard layout, in my case Finnish (040b)
– SystemLocale = Location of computer, how local numbers and dates will be shown
– UILanguageFallback = US English can be used in all language versions, it tells in which language should messages and notifications to be shown if localized ones are not available
– UserLocale = End user location
Some common locale values:
– Brazil – Portuguese > 0416:00000416, pt-BR
– Canada – English > 1009:00000409, en-CA
– Canada – French > 0c0c:00011009, fr-CA
– France – French > 040c:0000040c, fr-FR
– Germany – German > 0407:00000407, de-DE
– UK – English > 0809:00000809, en-GB
– USA – English > 0409:00000409, en-US
Full list of Windows locales: Default Input Profiles (Input Locales) in Windows – Microsoft Docs
The DiskConfiguration part takes care of partitioning the hard disk. CreatePartition settings create UEFI and Windows partitions, ModifyPartition settings then tell Windows setup which partition is for what. This answer file will wipe Disk 0 (primary HDD / SSD) empty, create required UEFI partitions and then use all free space for C: drive, the Windows partition:
<DiskConfiguration> <Disk wcm:action="add"> <CreatePartitions> <CreatePartition wcm:action="add"> <Order>1</Order> <Size>450</Size> <Type>Primary</Type> </CreatePartition> <CreatePartition wcm:action="add"> <Order>2</Order> <Size>100</Size> <Type>EFI</Type> </CreatePartition> <CreatePartition wcm:action="add"> <Order>3</Order> <Size>16</Size> <Type>MSR</Type> </CreatePartition> <CreatePartition wcm:action="add"> <Extend>true</Extend> <Order>4</Order> <Type>Primary</Type> </CreatePartition> </CreatePartitions> <ModifyPartitions> <ModifyPartition wcm:action="add"> <Format>NTFS</Format> <Label>WinRE</Label> <Order>1</Order> <PartitionID>1</PartitionID> <TypeID>DE94BBA4-06D1-4D40-A16A-BFD50179D6AC</TypeID> </ModifyPartition> <ModifyPartition wcm:action="add"> <Format>FAT32</Format> <Label>System</Label> <Order>2</Order> <PartitionID>2</PartitionID> </ModifyPartition> <ModifyPartition wcm:action="add"> <Order>3</Order> <PartitionID>3</PartitionID> </ModifyPartition> <ModifyPartition wcm:action="add"> <Format>NTFS</Format> <Label>Windows</Label> <Letter>C</Letter> <Order>4</Order> <PartitionID>4</PartitionID> </ModifyPartition> </ModifyPartitions> <DiskID>0</DiskID> <WillWipeDisk>true</WillWipeDisk> </Disk> </DiskConfiguration>
The UserData part tells Windows Setup which edition will be installed using a generic product key, accepts EULA and tells Windows Setup which organization this Windows device belongs to:
<UserData> <ProductKey> <Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key> </ProductKey> <AcceptEula>true</AcceptEula> <Organization>Win10.guru</Organization> </UserData>
Generic product keys:
– Windows 10 Home Single Language: 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH
– Windows 10 Home: TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
– Windows 10 Pro: VK7JG-NPHTM-C97JM-9MPGT-3V66T
Education, Enterprise and Server editions, see following support article for generic install keys: Appendix A: KMS Client Setup Keys
In OOBE section we tell Windows Setup to skip all questions / dialogs shown in OOBE in normal installation:
<OOBE> <VMModeOptimizations> <SkipAdministratorProfileRemoval>false</SkipAdministratorProfileRemoval> </VMModeOptimizations> <HideEULAPage>true</HideEULAPage> <HideLocalAccountScreen>true</HideLocalAccountScreen> <HideOnlineAccountScreens>true</HideOnlineAccountScreens> <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> <ProtectYourPC>1</ProtectYourPC> <UnattendEnableRetailDemo>false</UnattendEnableRetailDemo> </OOBE>
In UserAccounts, we create one local admin account:
<UserAccounts> <LocalAccounts> <LocalAccount wcm:action="add"> <Description>Local admin account</Description> <DisplayName>Admin</DisplayName> <Group>Administrators</Group> <Name>Admin</Name> </LocalAccount> </LocalAccounts> </UserAccounts>
Description is optional. DisplayName is how user is shown for instance on Welcome and sign-in screens, Name is how user profile and profile folder will be named. Name and DisplayName don't have to be same.
If you want to, you can create more user accounts here. An example of UserAccounts section creating one admin account, one standard account, and one guest account:
<UserAccounts> <LocalAccounts> <LocalAccount wcm:action="add"> <Description>Local admin account</Description> <DisplayName>Admin</DisplayName> <Group>Administrators</Group> <Name>Admin</Name> </LocalAccount> <LocalAccount wcm:action="add"> <Description>Standard user account</Description> <DisplayName>Kari</DisplayName> <Group>Users</Group> <Name>Kari</Name> </LocalAccount> <LocalAccount wcm:action="add"> <Description>Guest at Casa Kari</Description> <DisplayName>Visitor</DisplayName> <Group>Guests</Group> <Name>Visitor</Name> </LocalAccount> </LocalAccounts> </UserAccounts>
After UserAccounts, we provide Windows Setup with data about the organization, the PC's owner and the local Windows time zone:
<RegisteredOrganization>Win10.guru</RegisteredOrganization> <RegisteredOwner>Kari</RegisteredOwner> <TimeZone>W. Europe Standard Time</TimeZone>
See all time zones values: Microsoft Time Zone Index Values
That's it. Save the file as autounattend.xml on root of your Windows 10 install USB media:
Windows setup and installation will now be totally automatic. Just boot the PC from the USB media, next stop will be Windows desktop! All done without any whatsoever user interaction.
Kari
Author: Kari Finn
A former Windows Insider MVP, Kari started in computing in the mid 80's writing code for VAX / VMS systems. Since then, he's worked in a variety of IT positions. He specializes in Windows image capture, customization, repair and deployment as well as Hyper-V virtualization. Kari is a proud Team Member at number #1 Windows site TenForums.com.
How To Create An Autounattend Xml File
Source: https://win10.guru/simple-deployment-with-autounattend-xml-answer-file/
Posted by: robbinsangleatild.blogspot.com
0 Response to "How To Create An Autounattend Xml File"
Post a Comment