Sign in to follow this  
Followers 0
anyweb

How can I use PowerShell to deploy Windows 10 x64 to the Microsoft Surface Pro 4 using MDT 2013 Update 2



1 post in this topic

Introduction

In a previous post I showed you how you can deploy Windows 10 x64 (version 1507) to the Microsoft Surface Pro 4 using MDT 2013 Update 1.

 

This script has been updated with the following changes:

  • Windows 10 x64 (version 1511, updated February 2016 media)
  • Microsoft Deployment Toolkit (MDT) 2013 Update 2
  • Latest available 2016 drivers for the Surface Pro 4
  • Windows 10 ADK (version 1511)

running the script.png

 

Note: Microsoft has released two versions of Windows 10 x64 (version 1511). The first release was the original and released in November 2015, the second release was an updated release in February 2016. For this guide I've used the February 2016 release available on the Microsoft Volume License Site. The script does care which release you use, as the previous release of Windows 10 x64 version 1511 shows up as Technical Preview wheras the February release does not.

 

two windows 10 1511 releases.png

 

Note: This is fully automated, and as this does install a Windoes Deployment Services server role hosting a boot image, you should modify the script accordingly and test it thoroughly in a lab first.

 

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 Update 2 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 1511) if you have not done so already
  • Downloads and then Installs MDT 2013 Update 2 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 1511) 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 1511) 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 (running Windows Server 2012 R2) that is designated to be the MDT 2013 server. I've tested it on Windows Server 2012R2 only, if you run it on a different operating system and have issues then please post your results below.

 

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 59) 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.

 

line 59.png

 

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

 

folderpath variable.png

 

There are other variables to configure, for joining the Domain (lines 316-318)

 

join domain variables.png

 

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

 

connect to mdt.png

 

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

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

 

copy windows 10 media.png

 

Step 4. Optionally copy MDT 2013 Update 2, 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. You do not have to do this as the script will download the content for you if it's not found.

 

optional components.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

 

application guid.png

 

as shown here (line 358)

 

app guid for mandatory app.png

 

Step 6. Run the script

On the server that is to be your MDT server, start PowerShell ISE as Administrator.

 

run ISE as administrator.png

 

Click on the green triangle to run the script. Below you can see the script in action

 

script in action.png

 

After the script is complete, you are ready to test deploying a Microsoft Surface Pro 4 installation.

 

script is complete.png

 

After running the script you can see that WDS is installed and that the LiteTouch_X64 boot wim is imported into WDS.

 

boot image added to wds.png

 

After opening the Deployment Workbench, you can see the Deploy Windows 10 x64 - Surface Pro 4 task sequence is created

 

deploy windows 10 x64 task sequence.png

 

The Surface Pro 4 drivers step is configured

 

surface pro 4 drivers step.png

 

and the WMI query for the hardware is also added

 

surface pro 4 wmi query.png

 

and drivers specific to the Surface Pro 4 are imported

 

drivers in deployment workbench.png

 

and custom selection profiles are created

 

selection profiles.png

 

Step 7. Sit back and watch the deployment

Take a properly shutdown Surface Pro 4, and power it on using the following sequence. Hold the down volume key and then press the power button while continuing to hold down the volume key, it should PXE boot. Press enter when prompted

 

wds boot manager.png

 

and then it will load the MDT LitetouchPE_X64 boot wim.

 

loading boot wim.png

 

before prompting you for a computer name, note that it's currently set to SurfacePro4 in CustomSettings.ini contained within the script,

 

prompt for computername.png

 

If you have optional apps they'll be listed here along with the mandatory Office 365 ProPlus

 

office 365.png

 

you can change that behavior in the UI itself (CustomSettings.ini on the Properties/Rules of the DeploymentShare) or automate it via the many methods available such as those that Mikael describes here

 

click Next and off it goes,

 

running lite touch installation.png

 

before installing the Applications..

 

installing the apps.png

 

and finally it's all complete !

 

all done.png

 

Troubleshooting

If the script has issues starting WDS (and you see the error below)

 

An error occurred while trying to execute the command.
Error Code: 0x41D
Error Description: The service did not respond to the start or control request in a timely fashion.

 

 

then restart the server, as you were asked to do at the end of the script ;-).

 

If you cannot PXE boot, because WDS is not accepting connections (revealed by the PXE Response tab in WDS properties), then look for the following error in the scripts output:

setting PXE response policy...
Windows Deployment Services Management Utility [Version 6.3.9600.16384]
© 2013 Microsoft Corporation. All rights reserved.


An error occurred while trying to execute the command.
Error Code: 0x5
Error Description: Access is denied.

If you see that error, then the user you are logged in as does not have sufficient permissions to configure WDS. To resolve, make sure to Delegate permission in Active Directory for the User you are running this as, and allow that user Full Control of Computer Objects in that OU.

 

full control of computer objects.png

 

You can test whether the permission change works by issuing the following after the script is complete:

WDSUTIL /Set-Server /AnswerClients:All

For deployment issues, you can review the logs found in the following locations depending on what part of the OSD process you are in:-

 

In WinPE

  • X:\windows\temp\SMSTSLOG

In Windows

  • C:\Windows\Temp\DeploymentLogs
  • C:\MININT\SMSOSD\OSDLOGS
  • C:\Users\Administrator\Appdata\Local\temp\SMSTSLog

Summary

 

Automating the deployment of Windows 10 x64 Enterprise to the Microsoft Surface Pro 4 is possible and script-able with PowerShell and MDT 2013 Update 2.

 

Related Reading

Downloads

 

Download the PowerShell script - Deploy Microsoft Surface Pro 4 with MDT 2013 Update 2 - April 2016.zip

 

You can download a Microsoft Word copy of this guide here - How can I use PowerShell to deploy Windows 10 x64 to the Microsoft Surface Pro 4 using MDT 2013 Update 2.zip

Share this post


Link to post
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0