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 4 votes
Article Rating
Subscribe
Notify of
guest
46 Comments
Newest
Oldest Most Voted
Huzaifa Abbas
Huzaifa Abbas
1 year ago

Hi Johan
Thank you for sharing this awsome article. It helped me learn alot. These steps executed well.
One thing i am still finding a solution for is Applications installs(Chrome Enterprise, Slack) or BIOS Updates(Not important but good to have) before the system goes to AutoPilot Screen. I already tried editing the task sequence and unattend.xml but those did not work and always do something messy. Could you share some steps i can follow to achieve(Windows installation-> apps using exe installation -> BIOS installation/updating -> AutoPilot Screen)

Thanks again

Huzaifa Abbas
Huzaifa Abbas
10 months ago

Can we do Lenovo BIOS updates with custom logo installation (exe file)? I also want to install the apps(Google Chrome, Lenovo System Update) using MDT. I have tried different standard task sequences to land on OOBE screen similar to this but they always run into some script issues.
Can you please help me to include apps and Custom BIOS updates in this Task Sequence? or if there are some guides i may have missed?

Thanks again

Kaspars Gribusts
Kaspars Gribusts
1 year ago

Hello,John. Your post as always are very useful. My question would sound funny but i need to ask you this before trying to break some things. So currently have our MDT server where we prepare our devices – custom ISO, apps, domain join etc. Will this approach Windows Autopilot for Existing Devices will allow me to join device to domain and then kick in OOBE?

IAN
IAN
1 year ago

I got the following error during OOBE:

80180014 – This feature is not supported.

1tune
1tune
1 year ago

Hi John. Thank you for this article, almost exactly what we're looking for. We're moving to Intune over the summer and currently use MDT to image IT suites in a school environment. So with all these existing computers, we'd like to continue to reimage them using MDT and use your method to then enrol them to Intune. However, because these computers are shared classroom devices, we'd ideally like to use our Self-deploying Autopilot profile. Is this not possible at all? Thanks in advance.

1tune
1tune
1 year ago

Thank you for the response. Are you able to recommend any place to look into Autopilot via web service?

Last edited 1 year ago by 1tune
1tune
1tune
1 year ago

Thanks again Johan

FunkyDeez
FunkyDeez
1 year ago

Any chance you were able to get anything published to the community on this? Thanks for all your hardwork!!!!!

Bob Williams
Bob Williams
1 year ago

I notice that I have a MININT and LTIBootstrap.VBS still in the root of C: Should this have not been cleaned up?

Brent
Brent
1 year ago

This works wonderfully! Thank you so much for your help. I do have one question: my deployment seems to be skipping the "setting up for work or school" portion, which includes device preparation, device setup, and account setup. Overall, this isn't a big deal, but I was curious if there’s a way to restore that process. It’s been helpful for our build techs to use the deployment status page to know when a PC is fully configured. Currently, it prompts for credentials, logs into Windows, and then completes the deployment in the background.

Brett
Brett
1 year ago

I apologize if this is a silly question, but how would I go about doing this?

Shane Hazlett
Shane Hazlett
2 years ago

This is a lifesaver. I have a question though. I'm currently using this but the apps installing from InTune are taking forever. Is it possible to add the steps to install certain apps in the task sequence that are going to deploy to every single machine anyway? Or will it break the process?

Last edited 2 years ago by Shane Hazlett
James
James
2 years ago

This is a really great guide. Works great!

Last edited 2 years ago by James
Don
Don
2 years ago

Dear Johan, Thank you very much, for this very useful information, regarding autopilot. I just have one question, at the moment. I captured a wim from a Virtual Machine and whenever, I try to deploy that wim, to a PC, using the above solution, the startup menu on the PC, seems to get stuck at "Getting Ready" screen. Initially, the image copies down ok and then, the task gets as far as running the powershell script and after that, nothing else happens. The "Getting Ready" message appears constantly, on the screen, until the PC is manually turned off. Would anyone… Read more »

Martin R
Martin R
2 years ago

This is super cool stuff! This solution is very beneficial in my hybrid manufacturing environment! Thank you so much for putting this together! I will be following this page closely for future solutions.

Ignatii K
Ignatii K
2 years ago

Hello Johan,
Thanks for the marvellous work!
Do you think this task sequence can be used for Hybrid AutoPilot scenarios?
Local PS scripts work well but my last attempts using MDT give the PC/VM WAP profile status as "Not assigned".

Carl
Carl
2 years 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 years 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
2 years 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
2 years 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
2 years 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
2 years 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
2 years 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
2 years ago

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

Luis
Luis
2 years ago

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

Luis
Luis
2 years ago

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


>