vendredi 22 août 2014

Windows ADK et Windows PE : Configuration des disques dans un fichier unattend...

Bonjour à tous,

Nous avons découvert, le mois dernier, quatre articles relatifs au déploiement Windows avec MDT 2013 (liens en fin d'article).
Aujourd'hui, je vais vous montrer comment créer un fichier de réponse simple lié, dans cet exemple, à la configuration des disques durs.
Cette configuration concerne Windows 8.1 en environnement UEFI (Unified Extensible Firmware Interface).
Vous aussi, vous pouvez démarrer cette création en utilisant les examples disponibles dans les dossiers d'installation de Windows ADK.
Ces fichiers de réponse répondent au nom de Unattend.xml.
Vous les trouverez dans ce dossier "C:\Program Files (x86)\Windows kits\8.1\Assessment and Deployment kit\Deployment Tools\Samples\Unattend.
Au nombre de cinq, ils créent un environnement x86 et x64 BIOS, X64 UEFI, HeadLess et pour le déployment avec WDS.

L'exemple suivant concerne un environnement x64 UEFI commenté afin de vous aider à mieux comprendre cette création.
Quatre partitions seront créées sur le disque 0, une partition sur le second disque.
Le système d'exploitation Windows est installé sur la quatrième partition du premier disque 0.
Si les partitions sont dénombrées de 1 à 128 et jusqu'à 256 To, les disques, eux, sont dénombrés de 0 à n.

Disque 0
Partition 1 : Cachée pour Windows Recovery Environment NTFS de 300 Mo au moins et porte le TypeID de94bba4-06d1-4d40-a16a-bfd50179d6ac.
Partition 2 : Cachée pour la EFI System Partition FAT32 de 100 Mo. Le PC démarre sur celle-ci et est gérée par le système d'exploitation.
Partition 3 : Cachée pour Microsoft Reserved Partition de 128 Mo. Elle est présente sur chaque disque.
Partition 4 : Système d'Exploitation Windows NTFS de la taille restante du disque si non spécifiée ou à spécifier avec la balise <Size> mais supérieure à 20 Go pour x64 et 10 Go d'espace libre à la fin de l'installation du système.
Disque 1
Partition 1 : Données utilisateur de taille non spécifiée, donc la totalité du disque sinon précisée avec <Size>

Comment déterminer la taille de la partition utile ?
Utiliser la formule : Taille de l'image WIM * 1.1 + Tampon
Pour connaitre la taille de l'image vous exécutez en ligne de commande : DISM /Get-WimInfo /WimFile:D:\Deploy\install.wim où D:\Deploy\install.wim est le chemin du dossier dans lequel se trouve l'image à déployer.
Pour la valeur de Tampon, utiliser 1.2 Go pour x64, 1.1 Go pour x86 et 1.0 Go pour ARM.

La configuration, dans cet ordre, ainsi proposée, permet l'activation du chiffrement BitLocker ainsi que le stockage des données Win RE.

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <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>
                <Logo>Logo of the OEM</Logo>
                <Manufacturer>Patrice A. BONNEFOY - Microsoft MVP Windows Expert IT-Pro</Manufacturer>
                <SupportHours>08:00 - 12:00 / 14:00 - 19:00</SupportHours>
                <SupportPhone>+33.1.23.45.67.89</SupportPhone>
                <SupportURL>http://blogs.msmvps.com/vista/</SupportURL>
            </OEMInformation>
            <!-- Use this Microsoft-Windows-Shell-Setup\ProductKey if you are using a Volume-License Multiple-Activation Key (MAK)    -->
            <ProductKey>
                  <Key>XXXXX-XXXXX-XXXXX-XXXXX-XXXXX</Key>    <!-- It is not recommended to write down the product key or
                                            it must be wise to use the WillShowUI element with the Never value -->
                  <WillShowUI>Never</WillShowUI>
            </ProductKey>       
        </component>
    </settings>
    <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>fr-FR</UILanguage>        <!--    French language        -->
            </SetupUILanguage>
            <InputLocale>fr-FR</InputLocale>
            <SystemLocale>fr-FR</SystemLocale>
            <UILanguage>fr-FR</UILanguage>
            <UserLocale>fr-FR</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">
                <!-- First : Windows Recovery, Second : System partition, Three : Microsoft Reserved partition,
                     Four and next primary partitions.
                     This configuration is required for UEFI systems -->
                    <CreatePartitions>
                        <CreatePartition wcm:action="add">    <!-- This is the EFI Recovery partition -->
                            <Order>1</Order>
                            <Size>300</Size>    <!--  300 Mb    -->
                            <Type>Primary</Type>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">    <!-- This is the EFI system partition (ESP)    -->
                            <Order>2</Order>
                            <Size>100</Size>    <!--  100 Mb    -->
                            <Type>EFI</Type>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">    <!-- Microsoft reserved partition (MSR) is required for GUID partition table
                                                                    for UEFI/GPT-Based partitions Systems -->
                            <Order>3</Order>
                            <Size>128</Size>    <!--  128 Mb    -->
                            <Type>MSR</Type>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">    <!-- Windows partition  -->
                            <Order>4</Order>
                            <Extend>true</Extend>    <!--  No size : The rest of the disk is used    -->
                            <Type>Primary</Type>
                        </CreatePartition>
                    </CreatePartitions>
                    <ModifyPartitions>
                        <ModifyPartition wcm:action="add">
                            <Order>1</Order>
                            <Format>NTFS</Format>
                            <Label>Windows RE tools</Label>
                            <PartitionID>1</PartitionID>    <!-- This is the TypeID of the WinRE partition
                                                                        (0x27 for BIOS/MBR-Based Systems)    -->
                            <TypeID>de94bba4-06d1-4d40-a16a-bfd50179d6ac</TypeID>
                        </ModifyPartition>
                        <ModifyPartition wcm:action="add">
                            <Order>2</Order>
                            <PartitionID>2</PartitionID>
                            <Label>System</Label>
                            <Format>FAT32</Format>
                        </ModifyPartition>
                        <ModifyPartition wcm:action="add">
                            <Order>3</Order>
                            <PartitionID>3</PartitionID>
                        </ModifyPartition>
                        <ModifyPartition wcm:action="add">
                            <Order>4</Order>
                            <PartitionID>4</PartitionID>
                            <Label>Windows</Label>
                            <Letter>C</Letter>
                            <Format>NTFS</Format>
                        </ModifyPartition>
                    </ModifyPartitions>
                    <DiskID>0</DiskID>
                    <WillWipeDisk>true</WillWipeDisk>    <!-- This element specifies if all partitions and data must be erased on the hard disk before to add additional configurations to the disk    -->
                </Disk>

              <!-- If there is another hard drive... -->
              <Disk wcm:action="add">
                <DiskID>1</DiskID>
                <WillWipeDisk>true</WillWipeDisk>
                <CreatePartitions>

                  <!-- Data partition -->
                  <CreatePartition wcm:action="add">
                    <Order>1</Order>
                    <Type>Primary</Type>
                    <Extend>true</Extend>
                  </CreatePartition>

                </CreatePartitions>
                <ModifyPartitions>

                  <!-- Data partition -->
                  <ModifyPartition wcm:action="add">
                    <Order>1</Order>
                    <PartitionID>1</PartitionID>
                    <Label>Data</Label>
                    <Letter>D</Letter>
                    <Format>NTFS</Format>
                  </ModifyPartition>

                </ModifyPartitions>
              </Disk>
               
              <WillShowUI>OnError</WillShowUI>    <!--    This element specifies in what circumstances to display the user interface (UI) for disk configuration. Three values : Always, OnError and Never    -->
            </DiskConfiguration>
            <ImageInstall>        <!-- The OS image will be installed on the fourth partition of the first disk    -->
                <OSImage>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>4</PartitionID>
                    </InstallTo>
                </OSImage>
            </ImageInstall>

            <!-- Use this UserData for Microsoft-Windows-Setup\ProductKey        -->           
            <UserData>
                <AcceptEula>true</AcceptEula>
                <ProductKey>
                    <WillShowUI>OnError</WillShowUI>    <!-- It is not recommended to write down the product key or
                                            it must be wise to use the WillShowUI element with the Never or OnError values -->
                    <Key></Key>
                </ProductKey>
            </UserData>
           
        </component>
    </settings>
</unattend>



Précision importante : lorsque vous préparez un déploiement avec MDT 2013, il n’est pas judicieux de modifier le fichier Unattend hors de l’éditeur Windows SIM. Il vaut mieux modifier à partir des propriétés de séquence de tâches (voir image) puis, mettre à jour le fichier et dossier de déploiement.

Plus d'informations
Windows ADK : outil de base du déploiement des systèmes Windows® http://ruewindows.blogspot.fr/2014/08/windows-adk-outil-de-base-du.html
Déployer Windows avec MDT 2013: Partie 1 - Le contexte  http://ruewindows.blogspot.fr/2014/08/deployer-avec-mdt-2013-partie-1-le.html
Déployer Windows avec MDT 2013 : Partie 2 - Installation Serveurs et logiciels  http://ruewindows.blogspot.fr/2014/08/deployer-avec-mdt-2013-partie-2.html
Déployer Windows avec MDT 2013 : Partie 3 - Configurations et intégrations Software  http://ruewindows.blogspot.fr/2014/08/deployer-windows-avec-mdt-2013-partie-3.html
Déployer Windows avec MDT 2013 : Partie 4 - Déploiement de l’image  http://ruewindows.blogspot.fr/2014/08/deployer-windows-avec-mdt-2013-partie-4.html


Bonne soirée.
Patrice.

Aucun commentaire:

Enregistrer un commentaire

Même agressé(e) restez courtois ;-)