Interactively enroll Windows Device with Autopilot
To enroll a Windows device into Intune via Windows Autopilot, it is needed to register the serial number and hardware id in the tenant via an interactive login. The user has to log in as "Intune Administrator" and upload the information via Graph API into Intune. A GroupTag can also be set in the same step.
Guide
Open CMD window with "SHIFT" + "F10".
Then enter the following commands in this order. Important: Change the values for your GroupTag and tenant name.
powershell
Set-ExecutionPolicy RemoteSigned
Install-Script -Name "Get-WindowsAutopilotInfo" -Force
Directly Upload Hash ID and Serial to Windows Autopilot
Get-WindowsAutopilotInfo.ps1 -Online -GroupTag "<yourgrouptagname>" -TenantId "<yourtenantname>.onmicrosoft.com”
On the Browser Pop-Up sign in with an account that has Intune Administrator activated.
Restart-Computer
After the restart it will show you the welcome screen from your company there you can login with a normal account, if the person is authorized to enroll (device enrollment settings).
Write Output to CSV File
Alternatively you can export the information to a file which can be shared or copied using web tools or USB sticks.
Get-WindowsAutopilotInfo.ps1 -OutputFile C:\output.csv
Restart-Computer
After the restart it will show you the welcome screen from your company there you can login with a normal account, if the person is authorized to enroll (device enrollment settings).
Troubleshooting
If the time is not set correctly or is not recognized, the install script may fail. The SSL certificate check requires a correct time.