Tech Community Live: Endpoint Manager edition
Jul 21 2022, 08:00 AM - 12:00 PM (PDT)

Retrieve device info from CMD for autopilot

Super Contributor
Hi all, I want to start using AutoPilot on some devices, but I am getting issues with sending device info into "Windows Autopilot Devices" in intune. When I am on the OOBE of a device I press Shift + F10 to get CMD, then
 
  1. Powershell
  2. Set-Executionpolicy bypass
  3. Install-Script Get-WindowsAutoPilotInfo
I then Select Y which works for the first but then on the second I get an error: 
 
AB21805_0-1641548425556.jpeg

 

 
Any ideas why this is failing? 
10 Replies
I've never had this issue personally, however i have always plugged in a USB with the Script on so i can easily extract the CSV file and import it on demand.
Hi, How do I do this?

You could try this command line to get a better error output

Install-Script -Name Get-WindowsAutopilotInfo -Force -Verbose -Debug

Another possibility would be to indeed download the get-windowsautopilot.ps1 file and place it on a USB stick... We are also doing the same and built in some additional checks
Hi Rudy

Where would I find the get-windowsautopilot.ps1 and how would I run it from cmd after running powershell?
Hi

You could search the powershell galery https://www.powershellgallery.com/packages/Get-WindowsAutoPilotInfo/3.5

Download it and save it something like autopilot.ps1 you can run it like this (if the cmd is in the same folder as the autopilot file)

powershell.exe -executionpolicy bypass .\autopilot.ps1
I have used powershell.exe -executionpolicy bypass D:\Get-WindowsAutopiletinfo.ps1

this works however the details needed for intune go into the cmd window ideally it would be great if this could go straight into intune. I have seen this done by adding -online but I cant seem to get it to work or if this isnt possible how to I add it to a csv on to the memory stick
Normally it would be

Get-WindowsAutoPilotInfo.ps1 -online -addtogroup “AutoPilotstaticgroup” -assign

You can also download the autopilot module from this blog as I am not sure if the one you downloaded it totally up to date

https://call4cloud.nl/2020/10/autopilot-the-group-membership-war/

Hi @Rudy_Ooms_MVP 

 

I keep getting this, I know I have changed it so just using the online switch but stlll no luck even with the ps1 from the link provided. 

 

Screenshot 2022-01-07 at 12.42.10 PM.png

 

ANy ideas? 

 

Did you saved the get-windowsautopilot file in the system32 folder?

Hi @Rudy_Ooms_MVP 

 

No its not do I need to move it there? How do I get to the System32 folder via cmd window? 

 

I had the get-windowsautopilot file  on a memory stick