9 Replies Latest reply on Dec 7, 2016 3:17 AM by sthon

    My Windows 10 Imaging Guide

    sthon Apprentice

      So, as some people (according to the stats of my previous question at least) are interested in Windows 10 Deployment, I'll write a short summary of what I did to get it to run OK'ish with LANRev. Feel free to add your own thoughts or suggestions.

       

      The end result will be one Windows 10 image which can be deployed across multiple different Computer Types with different Hardware, different drive sizes, etc.

       

      I personally use a Virtual Machine to create a basic Image, just because it's easy and if something goes wrong, it's just a click to return to the previous version.

      2 Cores, 4GB of Ram, 60GB VHD, Bridged Networking are the basic settings for this.

       

      BIOS Settings:

      • UEFI is not (yet) working with the PXE Image and Server, so we have to stick to regular BIOS mode which is totally fine for Windows 10.
      • Activate AHCI (as we are using a mix of regular 'ol spinning disk drives and ssd it seems to be the best choice for now, also other settings have proven to be more unstable in regular office use)

      Thats it for now in BIOS.

       

      OS Installation and preparation

      • Install Windows 10 as a regular installation
      • Driver Integration (Thanks to Bao Tran for the Tipp on this!)
        • Create a Folder for drivers'n stuff
        • Download Drivers for all the target computers, sort and put into the driver folder (we use Dell only, so thats easy, they have all their drivers sorted out really good here).
        • Edit Windows Registry-Key to accomodate for the new "driver store": "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DevicePath" - the default value is "%SystemRoot%\inf", add a semicolon and your own path to it. This tells windows to addtionally look for drivers in this path withouth you having to interact with it.
      • Adding it to LANRev
        • Install the LANRev Agent with all your settings
        • Quickly change the Client Information 1 to reflect the name of your new image (I do this to see which image was used on a particular Computer and to compensate later for eventual errors in the image (eg. a forgotten software package,etc.)
        • Stop the LANRev agent Service and set it to startup type manual (we'll reactivate it later)
        • Delete Serialnumber of the Agent (HKLM\software\wow6432node\pole position software\lanrev\AgentSerialNo) on 64Bit OS
        • Add the empty AMImage file to the root filesystem
      • Install the lates OS Updates (this probably requires multiple reboots, hence the Agent to manual, otherwise it would start installing software right away as we do not have a testing environment as such)
      • Cleanup!
        • Delete temporary downloads and all the stuff you don't need in the image
        • Let Windows cleanup the drive, empty trash etc.
      • Save your VM state. This. Helps. A-Lot.
      • Sysprep the hell out of it. I'll post the cleaned up version of my unattend.xml below
        • C:\Windows\System32\Sysprep\Sysprep.exe /generalize /oobe /shutdown /unattend:<your unattend.xml>
      • After Shutdown:
        • Save the VM state in a new snapshot
          • Afer saving, make a dry run, see if the unattend xml is ok
        • If everything is ok
          • return to previous state and
          • Boot from PXE and create a ADI Image
        • If not
          • return to Snapshot before Sysprep
          • correct the errors

      After the re-imaging

      As I have the Image-Name as Custom Information 1, i can make smart-groups to assign Packages to computers with this image. The computers get the following done after imaging automatically:

      • Resize the Primary HDD (done automatically with diskpart)
      • Rename the computer according to service-tag (Dell only..? Done with a VB Script)
      • Run Dell DCU to update BIOS and Drivers (for Bios Updates, no Password should be set)
      • Install Office 365 2016
      • Install OneDrive for Business (Windows 10 only has the private one by default)
      • Install Silverlight
      • Install Antivirus

       

      Unattend.xml

      Beware, this is for a German install, so you have to edit to your locale and edit everything that starts with %Your...

      This XML has a auto-logon feature that logs on the local administrator automatically. It stops doing that when the computer joins the domain (we do that manually after imaging).

       

      <!--*************************************************
      Windows 10 Answer File Generator
      Created using Windows AFG found at:
      http://windowsafg.no-ip.org
      
      
      
      Installation Notes
      Location: 
      Notes: Enter your comments here...
      **************************************************-->
      
      
      <?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="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
      ">
      
        <SetupUILanguage>
        <UILanguage>de-DE</UILanguage>
        </SetupUILanguage>
        <InputLocale>0407:00000407</InputLocale>
        <SystemLocale>de-DE</SystemLocale>
        <UILanguage>de-DE</UILanguage>
        <UILanguageFallback>de-DE</UILanguageFallback>
        <UserLocale>de-DE</UserLocale>
        </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>de-DE</UILanguage>
        </SetupUILanguage>
        <InputLocale>0407:00000407</InputLocale>
        <SystemLocale>de-DE</SystemLocale>
        <UILanguage>de-DE</UILanguage>
        <UILanguageFallback>de-DE</UILanguageFallback>
        <UserLocale>de-DE</UserLocale>
        </component>
        <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
      ">
      
        <DiskConfiguration>
        <Disk wcm:action="add">
        <CreatePartitions>
        <CreatePartition wcm:action="add">
        <Order>1</Order>
        <Type>Primary</Type>
        <Size>100</Size>
        </CreatePartition>
        <CreatePartition wcm:action="add">
        <Extend>true</Extend>
        <Order>2</Order>
        <Type>Primary</Type>
        </CreatePartition>
        </CreatePartitions>
        <ModifyPartitions>
        <ModifyPartition wcm:action="add">
        <Active>true</Active>
        <Format>NTFS</Format>
        <Label>System Reserved</Label>
        <Order>1</Order>
        <PartitionID>1</PartitionID>
        <TypeID>0x27</TypeID>
        </ModifyPartition>
        <ModifyPartition wcm:action="add">
        <Active>true</Active>
        <Format>NTFS</Format>
        <Label>System</Label>
        <Letter>C</Letter>
        <Order>2</Order>
        <PartitionID>2</PartitionID>
        </ModifyPartition>
        </ModifyPartitions>
        <DiskID>0</DiskID>
        <WillWipeDisk>true</WillWipeDisk>
        </Disk>
        </DiskConfiguration>
        <ImageInstall>
        <OSImage>
        <InstallTo>
        <DiskID>0</DiskID>
        <PartitionID>2</PartitionID>
        </InstallTo>
        <InstallToAvailablePartition>false</InstallToAvailablePartition>
        </OSImage>
        </ImageInstall>
        <UserData>
        <AcceptEula>true</AcceptEula>
        <FullName>%YourLocalAdmin%</FullName>
        <Organization>%YourOrganisation%</Organization>
        </UserData>
        <EnableFirewall>true</EnableFirewall>
        </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>
        <Type>Primary</Type>
        <Size>100</Size>
        </CreatePartition>
        <CreatePartition wcm:action="add">
        <Extend>true</Extend>
        <Order>2</Order>
        <Type>Primary</Type>
        </CreatePartition>
        </CreatePartitions>
        <ModifyPartitions>
        <ModifyPartition wcm:action="add">
        <Active>true</Active>
        <Format>NTFS</Format>
        <Label>System Reserved</Label>
        <Order>1</Order>
        <PartitionID>1</PartitionID>
        <TypeID>0x27</TypeID>
        </ModifyPartition>
        <ModifyPartition wcm:action="add">
        <Active>true</Active>
        <Format>NTFS</Format>
        <Label>System</Label>
        <Letter>C</Letter>
        <Order>2</Order>
        <PartitionID>2</PartitionID>
        </ModifyPartition>
        </ModifyPartitions>
        <DiskID>0</DiskID>
        <WillWipeDisk>true</WillWipeDisk>
        </Disk>
        </DiskConfiguration>
        <ImageInstall>
        <OSImage>
        <InstallTo>
        <DiskID>0</DiskID>
        <PartitionID>2</PartitionID>
        </InstallTo>
        <InstallToAvailablePartition>false</InstallToAvailablePartition>
        </OSImage>
        </ImageInstall>
        <UserData>
        <AcceptEula>true</AcceptEula>
        <FullName>%YourLocalAdmin%</FullName>
        <Organization>%YourOrganisation%</Organization>
        </UserData>
        <EnableFirewall>true</EnableFirewall>
        </component>
        </settings>
        <settings pass="offlineServicing">
        <component name="Microsoft-Windows-LUA-Settings" 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
      ">
      
        <EnableLUA>true</EnableLUA>
        </component>
        </settings>
        <settings pass="offlineServicing">
        <component name="Microsoft-Windows-LUA-Settings" 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
      ">
      
        <EnableLUA>true</EnableLUA>
        </component>
        </settings>
        <settings pass="generalize">
        <component name="Microsoft-Windows-Security-SPP" 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
      ">
      
        <SkipRearm>1</SkipRearm>
        </component>
        </settings>
        <settings pass="generalize">
        <component name="Microsoft-Windows-Security-SPP" 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
      ">
      
        <SkipRearm>1</SkipRearm>
        </component>
        </settings>
        <settings pass="specialize">
        <component name="Microsoft-Windows-International-Core" 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
      ">
      
        <InputLocale>0407:00000407</InputLocale>
        <SystemLocale>de-DE</SystemLocale>
        <UILanguage>de-DE</UILanguage>
        <UILanguageFallback>de-DE</UILanguageFallback>
        <UserLocale>de-DE</UserLocale>
        </component>
        <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>0407:00000407</InputLocale>
        <SystemLocale>de-DE</SystemLocale>
        <UILanguage>de-DE</UILanguage>
        <UILanguageFallback>de-DE</UILanguageFallback>
        <UserLocale>de-DE</UserLocale>
        </component>
        <component name="Microsoft-Windows-Security-SPP-UX" 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
      ">
      
        <SkipAutoActivation>true</SkipAutoActivation>
        </component>
        <component name="Microsoft-Windows-Security-SPP-UX" 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
      ">
      
        <SkipAutoActivation>true</SkipAutoActivation>
        </component>
        <component name="Microsoft-Windows-SQMApi" 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
      ">
      
        <CEIPEnabled>0</CEIPEnabled>
        </component>
        <component name="Microsoft-Windows-SQMApi" 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
      ">
      
        <CEIPEnabled>0</CEIPEnabled>
        </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
      ">
      
        <ComputerName>%YourComputerName%</ComputerName>
        <ProductKey>%YourProductKey%</ProductKey>
        </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>%YourComputerName%</ComputerName>
        <ProductKey>%YourProductKey%</ProductKey>
        </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
      ">
      
        <AutoLogon>
        <Password>
        <Value>%YourLocalAdminPassword%</Value>
        <PlainText>true</PlainText>
        </Password>
        <Enabled>true</Enabled>
        <Username>%YourLocalAdmin%</Username>
        </AutoLogon>
        <OOBE>
        <HideEULAPage>true</HideEULAPage>
        <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
        <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
        <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
        <NetworkLocation>Work</NetworkLocation>
        <SkipUserOOBE>true</SkipUserOOBE>
        <SkipMachineOOBE>true</SkipMachineOOBE>
        <ProtectYourPC>1</ProtectYourPC>
        </OOBE>
        <UserAccounts>
        <LocalAccounts>
        <LocalAccount wcm:action="add">
        <Password>
        <Value>%YourLocalAdminPassword%</Value>
        <PlainText>true</PlainText>
        </Password>
        <Description></Description>
        <DisplayName>%YourLocalAdmin%</DisplayName>
        <Group>Administrators</Group>
        <Name>%YourLocalAdmin%</Name>
        </LocalAccount>
        </LocalAccounts>
        </UserAccounts>
        <RegisteredOrganization>%YourOrganisation%</RegisteredOrganization>
        <RegisteredOwner>%YourLocalAdmin%</RegisteredOwner>
        <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
        <FirstLogonCommands>
        <SynchronousCommand wcm:action="add">
        <Description>Control Panel View</Description>
        <Order>1</Order>
        <CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 1 /f</CommandLine>
        <RequiresUserInput>true</RequiresUserInput>
        </SynchronousCommand>
        <SynchronousCommand wcm:action="add">
        <Order>2</Order>
        <Description>Control Panel Icon Size</Description>
        <RequiresUserInput>false</RequiresUserInput>
        <CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 1 /f</CommandLine>
        </SynchronousCommand>
        <SynchronousCommand wcm:action="add">
        <Order>3</Order>
        <Description>LanREF: Agent Konfigurieren</Description>
        <RequiresUserInput>false</RequiresUserInput>
        <CommandLine>sc config "Absolute Manage Agent" start=auto</CommandLine>
        </SynchronousCommand>
        <SynchronousCommand wcm:action="add">
        <Order>4</Order>
        <Description>LanREF: Agent starten</Description>
        <RequiresUserInput>false</RequiresUserInput>
        <CommandLine>net start "Absolute Manage Agent"</CommandLine>
        </SynchronousCommand>
        <SynchronousCommand wcm:action="add">
        <Order>5</Order>
        <Description>LanREF: Am Server anmelden</Description>
        <RequiresUserInput>false</RequiresUserInput>
        <CommandLine>"%programfiles(x86)%\Pole Position Software\LANrevAgent\LANrev Agent.exe" --SendHeartbeat</CommandLine>
        </SynchronousCommand>
        <SynchronousCommand wcm:action="add">
        <Order>6</Order>
        <Description>LanREF: Inventory senden</Description>
        <RequiresUserInput>false</RequiresUserInput>
        <CommandLine>"%programfiles(x86)%\Pole Position Software\LANrevAgent\LANrev Agent.exe" --SendInventory</CommandLine>
        </SynchronousCommand>
        <SynchronousCommand wcm:action="add">
        <Order>7</Order>
        <Description>LanREF: Nach zugewiesener Software suchen</Description>
        <RequiresUserInput>false</RequiresUserInput>
        <CommandLine>"%programfiles(x86)%\Pole Position Software\LANrevAgent\LANrev Agent.exe" --SDCheck</CommandLine>
        </SynchronousCommand>
        </FirstLogonCommands>
        <TimeZone>W. Europe Standard Time</TimeZone>
        </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
      ">
      
        <AutoLogon>
        <Password>
        <Value>%YourLocalAdminPassword%</Value>
        <PlainText>true</PlainText>
        </Password>
        <Enabled>true</Enabled>
        <Username>%YourLocalAdmin%</Username>
        </AutoLogon>
        <OOBE>
        <HideEULAPage>true</HideEULAPage>
        <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
        <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
        <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
        <NetworkLocation>Work</NetworkLocation>
        <SkipUserOOBE>true</SkipUserOOBE>
        <SkipMachineOOBE>true</SkipMachineOOBE>
        <ProtectYourPC>1</ProtectYourPC>
        </OOBE>
        <UserAccounts>
        <LocalAccounts>
        <LocalAccount wcm:action="add">
        <Password>
        <Value>%YourLocalAdminPassword%</Value>
        <PlainText>true</PlainText>
        </Password>
        <Description></Description>
        <DisplayName>%YourLocalAdmin%</DisplayName>
        <Group>Administrators</Group>
        <Name>%YourLocalAdmin%</Name>
        </LocalAccount>
        </LocalAccounts>
        </UserAccounts>
        <RegisteredOrganization>%YourCompany%</RegisteredOrganization>
        <RegisteredOwner>%YourLocalAdmin%</RegisteredOwner>
        <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
        <FirstLogonCommands>
        <SynchronousCommand wcm:action="add">
        <Description>Control Panel View</Description>
        <Order>1</Order>
        <CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 1 /f</CommandLine>
        <RequiresUserInput>true</RequiresUserInput>
        </SynchronousCommand>
        <SynchronousCommand wcm:action="add">
        <Order>2</Order>
        <Description>Control Panel Icon Size</Description>
        <RequiresUserInput>false</RequiresUserInput>
        <CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 1 /f</CommandLine>
        </SynchronousCommand>
        </FirstLogonCommands>
        <TimeZone>W. Europe Standard Time</TimeZone>
        </component>
        </settings>
      </unattend>
      
      

       

      DiskPart Code

      in a cmd:

      diskpart /s "%~dp0extend.txt"
      
      

      extend.txt

      Select disk 0
      select partition 2
      extend
      
      

       

      Setting the Service Tag as Computername (Dell)

      dim NewName
      dim objWMIService
      dim colItems
      dim strComputer
      dim colComputers
      
      
      strComputer = "." 
      
      
      Set objWMIService = GetObject("winmgmts:" & _
        "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") 
      
      
      For Each objSMBIOS in objWMIService.ExecQuery("Select * from Win32_SystemEnclosure") 
        NewName=objSMBIOS.SerialNumber 
      Next
      
      
      strComputer = "."
      Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
      Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
      
      
      Set colComputers = objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")
      For Each objComputer in colComputers
        err = objComputer.Rename(NewName)
        if err <> 0 then
        wscript.quit -1
        else
        wscript.quit 0
        end if
      next
      
      
        • 1. Re: My Windows 10 Imaging Guide
          baotran Apprentice

          Stefan,

           

          Thanks for posting this great guide. I always get the warm fuzzies when I see customers sharing their experiences and knowledge.

           

          Bao

          • 2. Re: My Windows 10 Imaging Guide
            sthon Apprentice

            Small addition:

             

            I wrote that we change the state of the Absolute Manage Agent (We use 6.8.2 at the moment) at a later point, after i set the startup type to manual.

             

            This is done in the unattend.xml. There a few lines in there that set the agent to automatic, send a heartbeat to the server, transfer their inventory and make a software distribution check. This helps my colleagues that deploy the images to see that the Agent is doing stuff and they know when they can start looking on the server for the new pc.

            • 3. Re: My Windows 10 Imaging Guide
              patgmac1 Expert

              This is nifty guide. I would suggest converting this to a document (there's a link on the right side of page) and maintain it as a living document.

              1 of 1 people found this helpful
              • 4. Re: My Windows 10 Imaging Guide
                sthon Apprentice

                Ok, I'll do that.

                • 5. Re: My Windows 10 Imaging Guide
                  sthon Apprentice

                  So, I wanted to streamline the basically working version and managed to break it - don't worry, I have a backup ^^.

                   

                  I removed the whole part of Installing the Agent into the image, stopping the service, etc. and moved it into the unattend.xml.

                  I figured I don't need the whole service stopping, starting, etc. when the Agent installs automatically when the system boots up.

                   

                  Unfortunately, the agent won't properly start up when installed during the first boot. The Agent is installed, but the service will not start. That is not helpful at all.

                   

                  Anybody any got any Ideas about that issue?

                  • 6. Re: My Windows 10 Imaging Guide
                    sthon Apprentice

                    Nevermind, found the problem.

                     

                    I did too many things at the same time to properly grasp the reason for the installation failure.

                    I also edited the defaultdefaults.plist in the agent setup files to also add a client information 1 to the clients while installing. The installer really didn't like that. I removed the extra lines and now it's installing fine during the unattended part.

                    • 7. Re: My Windows 10 Imaging Guide
                      sthon Apprentice

                      I'll dump some code snippets here that maybe someone finds useful during his/her deployment...

                       

                      From a Batch, run another Batch with elevated privileges via Powershell:

                      Powershell Start-Process <batchtorun> -Verb runAs
                      
                      

                       

                      From a batch, change Power saving mode to max power during installation, tested with 7 and 10:

                      Powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
                      
                      

                       

                      Run this to install .net 3 into Windows 10, it downloads it from MS, so do it before imaging:

                      DISM /Online /Enable-Feature /FeatureName:NetFx3 /All
                      
                      

                       

                      This one runs the disk-cleanup from windows:

                      c:\windows\system32\cleanmgr /sagerun:1
                      
                      

                       

                      And this defragments the c: drive before imaging:

                      defrag c: /x /h 
                      
                      

                       

                      VB-Script: Compress the whole drive exceptProgram files, tested under Windwos 10:

                      strComputer = "."
                      
                      Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
                      
                      Set colFolders = objWMIService.ExecQuery ("Select * From Win32_Directory")
                      on error resume next
                      for Each objFolder in colFolders
                          if not ObjFolder.Name="C:\program Files" and not ObjFolder.name ="C:\program files (x86)" then
                        errResults = objFolder.Compress
                          end if
                      Next
                      on error goto 0
                      
                      

                       

                      And a big one:

                      VB-Script: Download and install Windows 10 Updates - I commented all the interactive part out, so that it can run under cscript without interaction. If you want it to ask you about all the downloads and installation just remove all the '.

                      Set updateSession = CreateObject("Microsoft.Update.Session")
                      updateSession.ClientApplicationID = "MSDN Sample Script"
                      
                      
                      Set updateSearcher = updateSession.CreateUpdateSearcher()
                      
                      
                      WScript.Echo "Searching for updates..." & vbCRLF
                      
                      
                      Set searchResult = _
                      updateSearcher.Search("IsInstalled=0 and Type='Software' and IsHidden=0")
                      
                      
                      WScript.Echo "List of applicable items on the machine:"
                      
                      
                      For I = 0 To searchResult.Updates.Count-1
                          Set update = searchResult.Updates.Item(I)
                          WScript.Echo I + 1 & "> " & update.Title
                      Next
                      
                      
                      If searchResult.Updates.Count = 0 Then
                          WScript.Echo "There are no applicable updates."
                          WScript.Quit
                      End If
                      
                      
                      WScript.Echo vbCRLF & "Creating collection of updates to download:"
                      
                      
                      Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl")
                      
                      
                      For I = 0 to searchResult.Updates.Count-1
                          Set update = searchResult.Updates.Item(I)
                          addThisUpdate = false
                          'If update.InstallationBehavior.CanRequestUserInput = true Then
                          '    WScript.Echo I + 1 & "> skipping: " & update.Title & _
                          '    " because it requires user input"
                          'Else
                          '    If update.EulaAccepted = false Then
                          '        WScript.Echo I + 1 & "> note: " & update.Title & _
                          '        " has a license agreement that must be accepted:"
                          '        WScript.Echo update.EulaText
                          '        WScript.Echo "Do you accept this license agreement? (Y/N)"
                          '        strInput = WScript.StdIn.Readline
                          '        WScript.Echo 
                          '        If (strInput = "Y" or strInput = "y") Then
                          '            update.AcceptEula()
                          '            addThisUpdate = true
                          '        Else
                          '            WScript.Echo I + 1 & "> skipping: " & update.Title & _
                          '            " because the license agreement was declined"
                          '        End If
                          '    Else
                                  addThisUpdate = true
                          '    End If
                          'End If
                          If addThisUpdate = true Then
                              WScript.Echo I + 1 & "> adding: " & update.Title 
                              updatesToDownload.Add(update)
                          End If
                      Next
                      
                      
                      If updatesToDownload.Count = 0 Then
                          WScript.Echo "All applicable updates were skipped."
                          WScript.Quit
                      End If
                          
                      WScript.Echo vbCRLF & "Downloading updates..."
                      
                      
                      Set downloader = updateSession.CreateUpdateDownloader() 
                      downloader.Updates = updatesToDownload
                      downloader.Download()
                      
                      
                      Set updatesToInstall = CreateObject("Microsoft.Update.UpdateColl")
                      
                      
                      rebootMayBeRequired = false
                      
                      
                      WScript.Echo vbCRLF & "Successfully downloaded updates:"
                      
                      
                      For I = 0 To searchResult.Updates.Count-1
                          set update = searchResult.Updates.Item(I)
                          If update.IsDownloaded = true Then
                              WScript.Echo I + 1 & "> " & update.Title 
                              updatesToInstall.Add(update) 
                              If update.InstallationBehavior.RebootBehavior > 0 Then
                                  rebootMayBeRequired = true
                              End If
                          End If
                      Next
                      
                      
                      If updatesToInstall.Count = 0 Then
                          WScript.Echo "No updates were successfully downloaded."
                          WScript.Quit
                      End If
                      
                      
                      If rebootMayBeRequired = true Then
                          WScript.Echo vbCRLF & "These updates may require a reboot."
                      End If
                      
                      
                      'WScript.Echo  vbCRLF & "Would you like to install updates now? (Y/N)"
                      'strInput = WScript.StdIn.Readline
                      'WScript.Echo 
                      
                      
                      'If (strInput = "Y" or strInput = "y") Then
                          WScript.Echo "Installing updates..."
                          Set installer = updateSession.CreateUpdateInstaller()
                          installer.Updates = updatesToInstall
                          Set installationResult = installer.Install()
                      
                          'Output results of install
                          WScript.Echo "Installation Result: " & _
                          installationResult.ResultCode 
                          WScript.Echo "Reboot Required: " & _ 
                          installationResult.RebootRequired & vbCRLF 
                          WScript.Echo "Listing of updates installed " & _
                          "and individual installation results:" 
                      
                          For I = 0 to updatesToInstall.Count - 1
                              WScript.Echo I + 1 & "> " & _
                              updatesToInstall.Item(i).Title & _
                              ": " & installationResult.GetUpdateResult(i).ResultCode   
                          Next
                      'End If
                      
                      
                      

                       

                      That's it for now. I am using all these to almost fully automate preparing a fresh Windows 10 install for the imaging process. Since the usual "load your old VM, update the system and reimage" won't work anymore with Windows 10 distribution updates (can't image an updates system) - I devised a method to automatically prepare a pure Windows install to our specs.

                      2 of 2 people found this helpful
                      • 8. Re: My Windows 10 Imaging Guide
                        philcebutv Apprentice

                        Hi what do you advice as we have the same model of PC all over the compound. I am not sure if I need to unattend.xml, does this file allow you to enroll to domain?

                         

                         

                        This is what my flow is but I am not sure if its the right

                        1. prepare one PC

                        2. install windows 10

                        3. install all software, drivers  including the lanrev agent. configure agent.

                        4. install all software and OS updates

                        5. sysprep it

                        6. capture

                        7. test and deploy

                         

                        do i need still to remove the serial number of the agent?

                        • 9. Re: My Windows 10 Imaging Guide
                          sthon Apprentice

                          Hi Phil,

                           

                          sorry for the late reply - I was on vacation.

                           

                          I personally do not like installing drivers into the image it makes it more complicated to update the image or use it for different machines.

                           

                          If you do not wish to use a unattend.xml, you need to prepare your PC exactly as you want it to be, and you'll definitely want to remove the Agent Serial number. And afaik sysprep won't work without a unattend.xml, but I am not sure about that.

                           

                          I get my PCs with a Powershell Script in the Domain as it did not work for me with the unattend.xml.

                          add-computer -Credential $credential -DomainName $domain -OUPath $ouPath -restart -force
                          
                          

                           

                          I have a more complicated workflow as my Image works with our 10 or so different computer models - desktops and laptops from Dell and Lenovo.