How can I automate the deployment of Windows 10 (Creators Update) using MDT and PowerShell ?

Introduction

This script has been written to allow you to automate the deployment Windows 10 version 1703 (Creators Update) using the latest available software including:

  • Windows 10 x64 (version 1703, MSDN media)
  • Microsoft Deployment Toolkit (MDT) build 8443
  • Latest available 2017 drivers for the Surface Pro 4
  • Windows 10 ADK (version 1703)
  • Windows Server 2016

Note: This is fully automated, and as this does install a Windows Deployment Services server role hosting a boot image, you should modify the script accordingly and test it thoroughly in a lab first. As ADK 1703 has an issue with Secure Boot, you must temporarily disable Secure Boot on your Windows Server 2016 prior to running this script, I will amend this post if ADK 1703 is re-released.

This script is tailored for one thing only, deploying Windows 10 x64 to the Microsoft Surface Pro 4 with all drivers loaded and MDT 2013 pre-configured. Download it and customize it to suit your needs for other hardware if you wish because what it does is pretty cool.

This script performs the following actions:-

  • Downloads and then Installs Windows ADK 10 (version 1703) if you have not done so already
  • Downloads and then Installs MDT, if you have not done so already
  • Downloads all required drivers for Microsoft Surface Pro 4 if you have not done so already
  • Imports the Windows 10 x64 (version 1703) operating system into MDT
  • Imports the Microsoft Surface Pro 4 drivers into MDT
  • Creates Selection Profiles for Microsoft Surface Pro 4 and WinPE x64
  • Creates a Deploy Windows 10 x64 – Surface Pro 4 task sequence
  • Edits the Deploy Windows 10 x64 – Surface Pro 4 task sequence and adds an inject drivers step for Microsoft Surface Pro 4
  • Sets a WMI query for hardware detection for the Surface Pro 4 on the corresponding driver step
  • Injects the Microsoft Surface Pro 4 network drivers into the LiteTouchPE_x64.wim
  • Creates custom CustomSettings.ini and BootStrap.ini files
  • Disables the X86 boot wim (as it is not needed for Surface Pro 4)
  • Changes the Selection Profile for the X64 boot wim to use the WinPE x64 selection profile
  • Installs the Windows Deployment Service role
  • Configures the WDS role and adds the previously created LiteTouchPE_x64.wim
  • Starts the WDS service so that you can PXE boot (UEFI network boot).

All you have to do is download the script below, modify some variables, then place certain files in the right place such as the Windows 10 x64 Enterprise (version 1703) media. Please ensure you have a working DHCP scope on your Active Directory domain controller, then PXE boot a Microsoft Surface Pro 4 and sit back and enjoy the show.

Step 1. Download the script

The PowerShell script will do all the hard work for you, it is in the Downloads section at the end of this guide, download it, unzip it and place it on a server that is designated to be the MDT server.

Note: If you use this on Windows Server 2016 then you’ll need to temporarily disable secure boot to allow ADK 1703 to install otherwise it will fail due to driver signing. Hopefully this will be fixed in an upcoming release of ADK 10 version 1703.

Step 2. Configure the variables in the script

Once you have downloaded and extracted the script, you need to configure certain variables interspersed throughout the script. I’ll highlight the ones you need to edit.

The most important of them is the $SourcePath variable (line 61) as this decides where to get the content from and where to store it. This variable should point to a valid drive letter, the folder name will be created if it does not exist.

sourcepath.png

The $FolderPath variable (line 242) specifies the MDT Deployment share root folder for example E:\MDTDeploy.

folderpath.png

There are other variables to configure, for joining the Domain (lines 320-322)

domain join.png

and then you need to configure how you actually connect to the MDT server from WinPE (lines 393-397)

connect to mdt.png

Step 3. Copy the Windows 10 x64 (version 1703) operating system files

Mount a Microsoft Windows 10 x64 Enterprise (version 1703) ISO and copy the contents to $SourcePath\Operating Systems\Windows 10 x64\1703 as shown below

1703 files.png

Step 4. Optionally copy MDT, ADK 10, Surface Pro 4 drivers

This is an optional step. If you’ve already downloaded the above files then place them in the source folder, otherwise the script will download them for you.

Note: You do not have to do this as the script will download the content for you if it’s not found.

optional files.png

Step 5. Optionally copy your Applications to the respective folders

This is an optional step. If you have apps like Office 365, copy them to their respective folders under Applications. If you do add any applications, you’ll need to edit the corresponding section within the script for the CustomSettings.ini and replace the GUID for the App

as shown here (line 362)

app guid.png

Step 6. Run the script

On the server that will become your MDT server, start PowerShell ISE as Administrator. Click on the green triangle to run the script. Below you can see the script in action:

script running.png

After the script is complete, you are ready to test deploying Windows 10 Creators Update to a Microsoft Surface Pro 4. You can see that Windows Deployment Services is installed and that the ADK 1703 version of the MDT LiteTouch_X64 boot wim is already imported. This boot image also has the Surface Pro 4 network drivers added.

Read the rest of this blog post here.

This entry was posted in 1703, MDT (build 8443), PowerShell, Windows 10. Bookmark the permalink.

Leave a Reply