Troubleshooting an Autopilot deployment

Here are some tips on how to test your Autopilot deployment. 

Test on a virtual machine!

My first advice would be to setup a test virtual machine. You can use your own preferred virtual machine software for this. First create a virtual machine and install it with a Windows 10 or 11 ISO. After the installation, use the following Powershell code to capture the Hardware ID. 

md c:\HWID Set-Location c:\HWID Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted -Force Install-Script -Name Get-WindowsAutopilotInfo -Force $env:Path += ";C:\Program Files\WindowsPowerShell\Scripts" Get-WindowsAutopilotInfo.ps1 -OutputFile AutopilotHWID.csv

When you’re running the code, you’ll be prompted to install the NuGet package. Choose Yes. When it’s finished, check the c:\HWID folder for the AutopilotHWID.CSV file. Upload the .csv file in Endpoint Manager (Devices, Enroll Devices, Devices and click the Import button in the ribbon.) Once this is done, the VM will be registered in the tenant. Use the Windows 10 or 11 reset function to reset the VM to the Out Of Box Experience. It is OK to remove all apps and files so you’ll have a clean installation once it’s done. The last thing you will want to do is to create a snapshot once the VM is back to the OOBE.

Nice right! So now you are able to perform an Autopilot deployment and revert back to snapshot when you want to try again.

Microsoft URL for more info (Using Hyper-V)

How to check apps installation failures

The Enrollment Status Page is a nice addition to show end users and admin’s how the installation is progressing. I’ve seen a couple of times that the installation basically freezes and doesn’t show any progress. So here’s a tip how to check which app is causing your deployment to fail. This will work best when the VM or computer has access to the internet.

So I talked about the Enrollment Status Page (ESP). Here’s where the progress freezes. Hit Shift+F10 to open a command prompt. Open up Powershell and set the execution policy to Bypass;

Set-ExecutionPolicy -ExecutionPolicy Bypass

Install the Get-AutopilotDiagnostics script;

install-Script Get-AutopilotDiagnostics

Accept the PATH variable change and the update for the NuGet Provider. Also accept the untrusted repository message. (The script will be pulled from the Microsoft Gallery).

Next up, run the script with the -online parameter;
Get-AutopilotDiagnostics.ps1 -online

The -online parameter will tell the script to check the installation status and apps and it will check the ID’s against the Microsoft Graph API. This step is where the app guids are replaced by the app names. Since we are talking to the API, we need to login.

So here’s a screenshot without the -online parameter:

Cool right! But basically we know that something went wrong. The -online parameter will fix that for us!

In this case I had a Win32 app ‘Workspace 365 Instructions’ which did not install correctly. 

I hope this helps in your journey to solve your Autopilot issues!

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *