MDT Task Sequence: Inline Surface Pro Pen Pairing without Image Modifications

Surface Pro tablets are great, for the most part. One of the most useful addons you can get for it is the Surface Pen. It’s great, powerful and useful… only if you remember to pair it to the tablet before giving it to the end-user.

I present to you the automated(ish) way to inject the pairing files into the OS and present you with the familiar pen pairing OOBE experience into MDT or SCCM during a deployment.


This works with all the Surface family of devices. It’s also a great wait to validate if your Surface Pen battery needs replacing.

The Surface Pro 3 Pen has batteries in two different locations. (replacement guide)

  • Main body of pen (1 x AAAA)  (stylus functions)
  • Inside the cap (2 x 319 coin cell) (bluetooth pairing).

Surface Pro 4 Pen, or “the new Surface Pen” has only one battery (1 x AAAA) for both the bluetooth and Stylus functions.


Adding the inline Surface Pen pairing sequence to a Surface Pro MDT deployment task.

Note: This procedure is as automated as I could make it. You may want to remove some variables and hard code the paths if it suits your MDT deployment better.

1) MDT 2013 (or newer)
2) Surface Pro client deployment task, setup to install Windows 10.
3) Existing Surface Pro with OEM image installed. Used to gather files for Pen Pairing during OOBE. (see below for a list of required files)


File and Folder Structure

As you can see, I have used the required English language files, substitute for your own language needs.
On the OEM source OS, the files are located in the folder “C:\Windows\System32\oobe\“.
Copy the entire “Info” folder and then extract what you need based on the file list below.

Note: You should copy the files from a factory image for the same model Surface device that you intend to deploy to. For example, you should use the files from a Surface Pro 3 to deploy to Surface Pro 3, and the files from Surface Book to deploy Surface Book, but you should not use the files from a Surface Pro 3 to deploy Surface Book or Surface Pro 4.


Files are listed under the folder they are to be placed into.
Create the folder structure in the Surface Pro task sequence control folder.
i.e. D:\DeploymentShare\Control\W10E_X64_SP4_01\



Task Sequence Structure

In the task sequence, add the “Run Command Line” under the “Install” folder, just after “Install Operating System”.
Note: The command line below may have wrapped, it should be one single line.

Type:                     Run Command Line
Name:                    Copy OOBE Pen Files
Command line:     xcopy.exe “%DeployRoot%\Control\%TaskSequenceID%\ExtraFiles\SP_Pen\*.*” “%OSDISK%\Windows\System32\oobe” /Q /H /E /I /Y
Start in:                 %DeployRoot%


When the task sequence runs, it will inject the required files into the installed OS just before the OOBE task runs. As there is now something for the OOBE experience to run, it will popup the pen pairing screen.

Please remember, this task sequence interrupts the automated deployment. You need to pair the pen within a certain amount of time (you get 3 chances) or it goes to a failure to pair screen and waits for acknowledgement to continue.

After pairing or acknowledgement of the failure to pair, the task sequence will continue and finish setting up your Surface tablet.




Source(s): Microsoft

Posted in MDT