Create and Import Autopilot CSV File into Intune from OOBE

Create and Import Autopilot CSV File into Intune from OOBE script will download all required modules and get-windowsautopilotinfo script, create a CSV (Hash) file and import it into Intune.

You can use this script to create and import csv to intune from windows as well and not only OOBE

 

UPDATED VERSION: Because of Connect-AutopilotIntune cmdlet disappearing from the module, script is updated and now it is using Connect-MSGraph. Script will download additional module (Microsoft.Graph.Intune) and login. Everything else will work the same. 

OBS!!! If you are accessing MS Graph for the first time, make sure that you create application identity. Without this you will not be able to use this script. Easiest way is to download the Microsoft.Graph.Intune module and connect to ms graph before you run the script. When you do this, you will be prompted to give your account permission. After this step, you will be able to run the script. 

 

Prerequisites 

Before you go and use Autopilot option, devices need to meet these requirements:

 

Process

Start the computer and press Shift + F10 to access CMD. Type in Powershell and run Set-ExecutionPolicy Unrestricted -Force

Browse to the location where you have saved script and run it

First that it comes up is the username that you gonna use to connect to Intune and import the CSV file. Once done press enter

It will then download and install Azure AD, Microsoft.Graph.Intune and WindowsAutopilotIntune modules and Get-WindowsAutoPilotInfo script

Once done, it will prompt for the password to connect to the Microsoft Graph. It will then create a CSV file in a temp folder and import it into Intune. 

You can verify it by running Get-AutoPilotDevice or by going to Azure Portal --> Intune --> Windows Enrollment --> Devices

Author: Nedim Mehic

Site: NEDIMMEHIC.ORG