How to Import Windows Updates in the Windows reference Image from the MDT

When you setup success the Reference Image with the MDT you have create an Automation tool for your Deployments. But after a period of time new Windows Updates arise and your Reference Image it's not up to date.

Import Windows Updates from the Task Sequence it takes lot of time. For this reason today i would like to describe how can keep your Reference Image up to date while import the Windows updates without loose lot of time.

The problem is the Windows Updates and how can update regularly your Reference Image with the latest Windows Updates.

The task can take between 1 - 2 hours depends of the Windows Updates that you want to Import in your Reference Image and the Performance of your Workstation-Server.

What do you need to do to keep your Reference Image up to date?

Here is the solution as simple can be.

Setup your Reference Image

The first step is to deploy Windows Image from your MDT as a Virtual Machine. You can follow the guides base on your infrastructure.

How Deploy Windows image using MDT and WDS in Windows Server 2016 (Part 1)

OR

How to Deploy a Windows 10 Custom Image with MDT

  • When the new Virtual Machine from your Reference Image is ready and has Internet access you must install the Powershell module PSWindowsUpdate.
  • Open a Powershell and type the following command
    Install-Module  PSWindowsUpdate
  • You will get a warning but just click Yes.
  • Now type Get-WindowsUpdate
  • Wait until receive the Windows Updates that must be install and you will get a list.
Get Windows Updates from powershell command

 

  • Open the Microsoft Update Catalog and download the Windows Updates which are missing base on the KB and the Windows OS that you have.

 

  • After you have download all the Windows Updates we are ready to add in your Image.

 

How to Add Windows Updates Packages in your Image

  • Login in your Server with the MDT
  • Create a folder with a name that you are prefer to copy the files that will be use.
  • Go in Operating System folder from MDT (Deployment Shares) with your image that you want to import the Windows Updates.
  • In my scenario is the Windows Server 2016 Std
  • Open the folder sources and copy the files boot.wim and install.wim in the folder that created above. For me is the win2016 folder.

 

  • Create a subfolder into the win2016 folder as updates or whatever you want and copy the Windows Updates that you have downloaded.
  • Open a powershell command as administrator
  • Type Get-WindowsImage C:\win2016\install.wim
  • You can see the 4 different options that included in this Windows Image.

 

  • Let's remove all the options except Windows Server 2016 Std
  • Type  Remove-WindowsImage -ImagePath c:\win20016\install.wim -index 1
  • The -index is the number of the ImageIndex from the different options
Remove options from Windows Image with powershell command

 

  • After remove the first option type again Get-WindowsImage C:\win2016\install.wim and remove the unecessary options base on the ImageIndex
  • Now i have only the Windows Server Standard option.

 

  • You can keep any Version of the Windows Server base on your requirements.
  • Just be careful  the ImageIndex number to be the right one when remove the options.
  • Now let's create a new folder.
  • Type mkdir c:\offline

 

  • We will use the offline folder to mount the Windows image and after add the Windows Updates
  • So type Mount-WindowsImage -ImagePath c:\win2016\install.wim -Index 1 -Path c:\offline
  • Wait until finish

 

  • Go in offline folder and you will see all the Windows folders after setup the Windows Server 2016

 

  • Now it's time to add the Windows updates
  • Type
  • Add-WindowsPackage -Path C:\offline -PackagePath C:\win2016\updates\
  • Wait until finish the import.
  • The time depends of the windows updates size and the Server\Workstation performance

 

  • When the import of the Windows updates finished successful we must Dismount the Image 
  • Type the following command
    Dismount-WindowsImage -Path c:\offline -Save
  • The time to dismount the image depends from the Windows Updates which import and the Performance 
Dismount the Windows Image with DISM command

 

  • When finish successful it's time to Import all the changes in the MDT

 

 

How to Import the Windows Image back to your MDT

Until now we have done the following:

  1. Setup if you don't have already the Reference Image to identify which updates must download.
  2. We have downloaded the required Windows Updates from the Microsoft Update Catalog, 
  3. We use DISM commands to import Windows Updates in the Windows Image that already have imported in MDT.

Now we need to proceed with the following tasks:

  1. Replace the install.wim and boot.wim in the Windows Image
  2. Re-Import the Windows Image in MDT
  3. Change the Task Sequence 

So let's proceed with the above tasks 

  • Right click in the Operating System that you want to replace with the new up to date and select Properties
  • Check the Path.

 

  • Copy and paste the folder in your Download folder
  • Copy the install.wim and boot.wim that we use to import the Windows updates in the source folder of the Windows Image that copy in your Download folder
Open the sources folder from the Windows Image

 

  • Delete the Operating System that you have import in MDT 
Delete Operating System from MDT

 

  • Import the Windows Image in your Download folder with the new files install.wim and boot.wim in MDT.
  • I wrote an article Building a Custom Windows ISO with MDT 2013 that you can find how can import the Operating System 
  • After import the Windows Image go In the Task Sequence that you have already created for the previous Operating System.
  • Click in Task Sequence Tab
  • Expand the Install folder
  • Select the Install Operating System. In the right side click Browse
Change Task Sequnce Properties in MDT

 

  • Select the Operating System which imported.
  • Click OK
Select Operating System for the Task Sequence in MDT

 

Now you are ready to Deploy the updated Windows Image.

You can send me an email at info@askme4tech.com  or do your comments in Twitter or Facebook

I invite you to follow me on Twitter or Facebook. If you have any questions, send email to me at info@askme4tech.com.

Disqus Comments