Forum Discussion
Get-WindowsAutoPilotInfo - A quicker way...
Andycap147 the whole process was designed that I know of to run under OOBE, you cant do it on pre-existing setups as it was all designed to run out of the box on new surface devices, as in the background and permissions, and apps etc are from Azure AD and Intune.
I was looking for the same setup where you could use pre-existing windows setups, but sadly it wasnt the case, as you would loose all existing apps.
sorry for the late reply
Instead of
PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command %~dp0\Get-WindowsAutoPilotInfo.ps1 -ComputerName $env:computername -OutputFile %~dp0\computers.csv -append,
Leave out the -ComputerName variable:
PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command %~dp0\Get-WindowsAutoPilotInfo.ps1 -OutputFile %~dp0\computers.csv -append
This defaults the script to localhost, which is what the script sees (I believe) in the OOB screen. Either way, it works.
- May 30, 2023Yes, but is the provided user an Intune Administrator role user? Does it have an Intune license assigned?
Alternatively, you could try this
https://powershellisfun.com/2022/07/09/upload-windows-autopilot-hardware-hash/
(my blog post) - NathanPinottiMay 30, 2023Copper Contributor
Harm_Veenstra, hi man! Did you manage to use it?
The documentation says that we need Intune admin to get the hash uploaded but when trying it says I don't have the permission. - SimonAllisonMay 02, 2022Iron ContributorYes it must have had some updates, and can go straight to tenant now, easy, but this was setup so you dont have to use the internet as these were offline laptops, but great if you can spare a network connection, I had all 60 laptops in a row, and so then created this script and thanks all of you with trying to get it to work and workarounds, its very helpful for others.
- Dec 30, 2021Why are you still using .csv files? You can run Get-Windowsautopilotinfo.ps1 -Online to upload it straight to your tenant.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-PackageProvider NuGet -MinimumVersion 2.8.5.201 -Force | Out-Null
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Script -Name get-WindowsAutoPilotInfo -Force
Get-WindowsAutoPilotInfo.ps1 -Online