Using MDT with Windows Autopilot for Existing Devices – Task Sequence Template and Scripts

While ConfigMgr has a ready-made task sequence template for the Windows Autopilot for Existing Devices scenario, MDT Lite Touch does not have one. Well, until now that is 🙂

On the link below you can download a new task sequence template for Windows Autopilot as well as the needed scripts and unattend.xml file:

Download link: https://github.com/DeploymentResearch/DRFiles/tree/master/Scripts/AutoPilot/MDT

Note #1: The Windows Autopilot for Existing Devices scenario requires that you download your Autopilot deployment profile as a JSON file. If you need a guide for downloading the profile, check this post: Windows Autopilot for Existing Devices – Downloading the Deployment Profile

Note #2: Ensure that your Windows Autopilot deployment profile is configured for either user-driven Microsoft Entra ID or user-driven hybrid Microsoft Entra Autopilot profiles. These are the only supported scenarios. For example, Self-deploying or pre-provisioning Autopilot profiles are not supported for this scenario.

The Task Sequence template and scripts

Download the files in from this GitHub repository, as well as your Windows Autopilot profile (AutopilotConfigurationFile.json). Then copy the files to the right locations:

1. Copy the downloaded AutopilotConfigurationFile.json to the <deployment share>\Autopilot folder (create the folder if needed).

AutopilotConfigurationFile.json file copied to the <deployment share>\Autopilot folder.

2. Copy the CleanupForAutopilot.ps1 script to the <deployment share>\scripts folder.

The CleanupForAutopilot.ps1 script copied to the to the <deployment share>\scripts folder.

3. Copy the WindowsAutoPilotForExistingDevices.xml template to the <deployment share>\Templates folder.

The WindowsAutoPilotForExistingDevices.xml template copied to the <deployment share>\Templates folder.

Using the new Task Sequence template

To use the new task sequence template, select the Windows Autopilot for Existing Devices template when creating a new task sequence.

Selecting the Windows Autopilot for Existing Devices template when creating a new task sequence.

1. After you created a new task sequence using the Windows Autopilot for Existing Devices template, make a note of the task sequence id, and copy the unattend.xml from the GitHub repository to the <deployment share>\control\<task sequence id> folder.

The unattend.xml template copied to the <deployment share>\control\<task sequence id> folder.

Reviewing the Task Sequence.

This is what the new task sequence should like when created using the Windows Autopilot for Existing Devices template.

The task sequence created from the Windows Autopilot for Existing Devices template.
About the author

Johan Arwidmark

5 2 votes
Article Rating
Subscribe
Notify of
guest
17 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Carl
Carl
2 months ago

Great Job Johan!! Got this working on my end. Question? I have a custom wim that I use for my client. Do you have any article and tips on OOBE to prompt the self deploy user to connect to his/her wireless network before autopilot starts. Just like when a regular use buys a brand new laptop from manufactures. On first boot, they are presented to connect to their home wireless network before language and keyboard prompts.

Carl
Carl
2 months ago

Thank you. I got it to work. After rebooting using your TS, and unplugging from the network, the users was prompted w/ wireless options. Thanks. 🙂

Joe Willis
Joe Willis
3 months ago

Will this work if device is already in autopilot? It seems that after the Install Operating system reboot, the next OOBE is interrupted by autopilot. At this point, the task sequence is abandoned, and the completion of driver injection never happens. Or am I missing something.

Gareth Edmondson
4 months ago

Gutted – got to the 'Setting up for work or school' page and it fails with:

Device Preparation:
Error
Securing your hardware (0x800705b4)

Any ideas? I thought I was there.

Cheers as always

Gareth

Gareth Edmondson
4 months ago

Got it all working, but are there meant to be manual steps? I'm probably wrong, but it would be great if certain things were hard coded – such as the Country (which is where it stops). Once I choose that, it then stops at the network choice screen. Once we pass through the various stops – away it goes.

Gareth Edmondson
4 months ago

Hi Johan – this is great. My biggest issue at the moment is the IT Tech people do not allow us access to MS Graph. I've looked at the older methods but the command Connect-AutopilotiIntune has been depreciated so I cannot find a way of downloading the profiles or turning them into JSON files.

I'm also getting an error when creating the task sequence when selecting the template:

'>' is an unexpected token. The expected token is '-'. Line 19, position 76.

I have no idea how to fix it.

Any ideas would be appreciated as always.

Gareth

Nelson
Nelson
5 months ago

I have been following your guides for years starting with the Deployment Fundamentals Vol 1 book. I implemented the scripts in this article on my MDT VM but have some issues. The test laptop I tried it on effectively became an orphaned machine object that is part of no autopilot groups on our tenant. There is no way that I can see to add the laptop to a provisioned group manual or dynamic. This means no provisioned autopilot group, no VPN. I had to manually install the company portal to load apps. It seemed to load some things but not… Read more »

Nelson
Nelson
5 months ago

Excellent as always Johan. I will work on your linked suggestion. I appreciate the assist!

Luis
Luis
5 months ago

This process will still require a human to finish the OOBE right?

Luis
Luis
5 months ago

Yea that's what we use now. Just hate renewing ppkgs.


>