Window Autopilot is getting better and better with every release of Microsoft Intune and Windows 10 build. The latest is that we can put a Autopilot payload down on the device before the OOBE and then make it a Autopilot device without collection the hardware hash for older devices or get the information from the OEM or reseller.

Back in October 2015 when I did my first Azure AD joined deployment in a public school, that was before Windows Autopilot but we had some of the same issue that we have today, one question was do we use the OEM image already on the device or do we use a custom image, at that time there was no good way of getting Office 365 click to run installed on the devices after they was Azure AD joined – so we went with a custom image deployed with MDT – see my blog post on who we did it here – today we can just deploy the Office 365 as an application directly from Intune in a nice and easy way.

Today we got Windows Autopilot and will love to use that – but have a similar issue, we have already deployed Windows devices deployed in a on-prem Active Directory and what to confirm them into a cloud managed device with Azure AD joined and Intune management – but there is no easy way of doing that. But with Windows 10 1809 we can deploy a Autopilot payload to the device before the OOBE and it will be a Autopilot device with all the advances it gets. This is a remaking of a blogpost I did in that start of November 2018

The outline of this blog post is:

  1. Deploy a custom updated image to a existent Windows device with MDT
  2. Download the Autopilot payload
  3. Get Windows installed
  4. Cleanup after MDT
  5. Deliver the device Autopilot enabled to the end user without having to collect the hardware hash and upload it to the Autopilot service

Prerequisite:

  • Windows 10 1809 or later
  • Azure AD P1 or P2 (A1 for Education – part of Intune for Education)
  • Microsoft Intune
  • Already created a Autopilot profile in Intune
  • Azure AD or Azure AD preview powershell module
  • Already have a MDT deployment solution up and running

How to get the Windows Autopilot payload:

We have to install the new WindowsAutopilotIntune powershell module

Install-module WindowsAutopilotIntune

AutoPilot Powershell 01

Connect to Autopilot Intune – with your Azure AD admin

Connect-AutopilotIntune

AutoPilot Powershell 02

Run the command to get the Intune Autopilot profile and convert it to .json

Get-Autopilotprofile | ConvertTo-AutopilotconfigurationJSON

AutoPilot Powershell 03

Then you can copy the content of the Autopilot profile to notepad and save as AutopilotConfigurationFile.json

Note: I had issue getting the AutopilotConfigurationFile.json working after copied the content to notepad – after ensuring that “CloudAssignedAadServerData” was in one line in the file every thing worked as a charm!

AutoPilot json profile.png

Note: remember to save as ANSI

Now we have the AutopilotConfigurationFile.json and are ready to create the MDT task Sequence.


How to customize the MDT Task Sequence for Autopilot:

In my case I use the MDT deployment share to other deployment as well as the Windows Autopilot deployment – so I will use a customsettings.ini from a task sequence

You need to create a custom deployment MDT task sequence then you can start make the changes to get it working for Autopilot deployment.

In my case I adds 10 steps into a custom MDT task Sequence:

  1. Gather local (Set a new Customsettings.ini (optional))
  2. Format and Partition Disk (BIOS) (Only use this if the devices do not support UEFI)
  3. Format and Partition Disk (UEFI)
  4. Copy scripts (Step from a standard MDT Task Sequence)
  5. ConfigureĀ (Step from a standard MDT Task Sequence)
  6. Install Operating System
  7. Apply the AutopilotConfigurationFile.json to the new device
  8. Delete unattend.xml
  9. Copy a SetupComplete.cmd to run some post cleanup after MDT
  10. Restart computer so that the device will end up in OOBE for the end user

Autopilot Fast Deployment with MDT - 01.png

First create your CustomeSettings_Autopilot.ini file – the one I use can be downloaded from here the file needs to be stored in your MDT deployment share under the Control folder.
In my case the important is that the device is not getting domain joined but ends up in a workgroup

MDT Customsettings

1 : Create a new “Gather local only” step

  1. Create a new “Gather local only” step
  2. Change to “Gather local data and process rules” with the rules file : CustomSettings_Autopilot.ini

Autopilot Fast Deployment with MDT - 02.png

2 : Format and Partition Disk (BIOS)

This step is to support legacy hardware that do not support UEFI – don’t use this on a new device that supports UEFI.

  1. Create a new “Format and Partition Disk (BIOS)” step

Autopilot Fast Deployment with MDT - 03.png

3 : Format and Partition Disk (UEFI)

This step is to configure the disk layout correct for a UEFI device

  1. Create a new “Format and Partition Disk (UEFI)” step

Autopilot Fast Deployment with MDT - 04.png

4 : Copy scripts

This step is to use the build-in functions of MDT

  1. Create a new “Run Command Line” action with the command line : script.exe “%SCRIPTROOT%\LTICopyScripts.wsf”

Autopilot Fast Deployment with MDT - 05.png

5 : Configure

This step is to use the build-in functions of MDT

  1. Create a new “Run Command Line” action with the command line : scscript.exe “%SCRIPTROOT%\ZTIConfigure.wsf”

Autopilot Fast Deployment with MDT - 06.png

6 : Install Operating System

This step is to use the build-in functions of MDT for installing the OS

  1. Create a new “Install Operating System” action and select the OS you want to install

Autopilot Fast Deployment with MDT - 07.png

7 : Apply Autopilot Profile

This step is to apply the AutopilotConfigurationFile.json to the new device

Create a stepĀ  to get the AutopilotConfigurationFile.json onto the new installed Windows 10 1809 or later – in my case I have created a folder in the MDT Deployment Share under scripts with my custom scripts.

  1. Create a step “Run Command Line ” enter the Command line :Ā xcopy %SCRIPTROOT%\Autopilot_default\AutopilotConfigurationFile.json %OSDisk%\Windows\provisioning\AutoPilot\ /c

Autopilot Fast Deployment with MDT - 08.png

8 : Delete unattend.xml

This step is to remove the unattend.xml file – so that Windows will start up in OOBE instead of continue to be deployed with the MDT Task Sequence

  1. Create a new “Run Command Line” action with the command line : cmd.exe /c del %OSDisk%\Windows\Panther\unattend.xml /s

Autopilot Fast Deployment with MDT - 09.png

9 : Setup Complete

This step is to copy the SetupComplete.cmd so that Windows Setup will run this script before the logon screens appears, the script will in this case cleanup after we just have broken the MDT deployment. Read more about SetupComplete.cmd

  1. Create a new “Run Command Line” action with the command line : xcopy %SCRIPTROOT%\Autopilot_default\SetupComplete.cmd %OSDisk%\Windows\Setup\Scripts\ /c

Autopilot Fast Deployment with MDT - 10.png

You need to create a SetupComplete.cmd script to clean up the last from MDT, the one I use can be downloaded from here

Autopilot Fast Deployment with MDT - 10a.png

10 : Restart computer

This step is to restart the computer so the end user will be able to get the OOBE expirence

  1. Create a set to Restart computer

Autopilot Fast Deployment with MDT - 11.png

 


What is the end user experience:

When you boot up into your MDT deployment share you will get a menu of all your MDT task Sequences – if you have not automated this step

  1. Select the Task Sequence with the Autopilot modifications
  2. Click Next

MDT UX - 01.png

After the OS Deployment and sysprep of the device, the next three screens is the region and keyboard part of the OOBE – then the end user can enter there user name.

MDT UX - 02.png

Happy testing!


Read more:

Upgrade Windows 7 using Windows Autopilot in Configuration Manager

New Windows Autopilot capabilities and expanded partner support simplify modern device deployment

Windows Autopilot for existing devices