How to upload device hash using Get-WindowsAutoPilotCommunity -Online variable to Microsoft Intune


Overview

This knowledge base article provides step-by-step instructions on how to get the device hash to your tenant to be ready to be assigned with a Windows Autopilot Deployment Profile using the PSGallery. 

Note: The -online flag only works if the user has Graph API access. By default, Intune admin accounts don't have this role.

Steps 

1. Start up a device that is out of the box (OOBE). Press Shift+F10 which loads to Command Prompt. Type in PowerShell then press Enter.

2. Type in the following:
Set-ExecutionPolicy Unrestricted -Force then press Enter
Install-Script Get-WindowsAutopilotInfoCommunity then press Enter.

When prompted for the following:

  • PATH Environment Variable Change, select Y then press Enter
  • Nuget provider is required to continue, select Y then press Enter
  • Untrusted repository, select Y then press Enter.

3. Type in the following:
Get-WindowsAutopilotInfoCommunity.ps1 -Online
Then this will perform to install the modules: Microsoft.graph.authentication and MS Graph Identity Authentication.

 

You will be prompted to login with your credentials (make sure to login with your credentials), this account must have an 'Intune Administrator role' license. Select Next.

4. After logging in successfully, the serial number will be uploaded to the tenant.

5. Once the profile is assigned by checking Windows Autopilot devices
6. Only perform this once the serial number been assigned to a deployment profile. On the same screen, type in shutdown -r /t 0 and this will do a soft reset and bring the device back to login screen.
7. The device will automatically restart and bring you to the login screen which will be ready for enrolment.