Get autopilot profile JSON-configuration files for offline deployment

Get autopilot profile JSON-configuration files for offline deployment


#EndpointManagement #Autopilot

Why?

It's not always possible to get the required file from your hardware supplier to register your devices in autopilot. There are a number of ways you can help yourself get around that. One way is to create a CSV yourself with the help of the powershell cmdlet Get-WindowsAutopilotInfo. In the latest version you can even use it to register the device for use with autopilot without needing to first create the CSV. But sometimes it's faster to use the offline autopilot configuration file.

How to use these files

The offline Windows Autopilot deployment profile can be used as from Windows 10, version 1809. The file needs to be named AutoPilotConfigurationFile.json must be made available on the device (or VM) in C:\Windows\Provisioning\Autopilot. If the file is present in this folder it will guide the machine to start the autopilot configuration without having to register it.

How to create these files with PowerShell

First install the required Modules:
Install-Module AzureAD -Force
Install-Module WindowsAutopilotIntune -Force
Install-Module Microsoft.Graph.Intune -Force
Export a file for each Autopilot profile you created

If you have only one profile and the path you want to save to exists you can do this with a simple oneliner after connecting to the Graph.

Connect-MSGraph

$AutopilotProfile | ConvertTo-AutopilotConfigurationJSON | Out-File C:\ExportPath\AutopilotConfigurationFile.json -Encoding ASCII

However, if you don't meet the above requirements you can use the following PowerShell lines (This script prefixes each filename with the autopilot-profile's name.):

Connect-MSGraph

$AutopilotProfiles = Get-AutopilotProfile

Foreach ($AutopilotProfile in $AutopilotProfiles) {

    $TempPath = "C:\ExportPath\"

    if (!(Test-Path $TempPath)) {
        New-Item -Path $TempPath -ItemType Directory -Force
    }

    $name = $AutopilotProfile.displayName
    $ExportPath = $TempPath + $name + "_AutopilotConfigurationFile.json"
    $AutopilotProfile | ConvertTo-AutopilotConfigurationJSON | Out-File $ExportPath -Encoding ASCII

} 

Modern Workplace Concierge

If you haven't yet, you should check out Nicola Suter's "Modern Workplace Concierge" app. Other than download these offline Autopilot profiles, this amazing webapp has lots more to offer. At the time of writing this:

  • Import and export Intune configuration and settings
  • Import and export Conditional Access policies
  • Document Conditional Access policies
  • Deploy a Conditional Access baseline
  • Download OSD ready offline Autopilot profiles
  • Re-download uploaded PowerShell scripts from Intune
  • Import trello boards to Microsoft Planner

You can even deploy your own instance. For example: https://mwconcierge.shellblazer.com.

Next Post