I have just published an update to the get-windowsautopilotinfocommunity PowerShell script available here:
Or from the PS Gallery
Install-Script -Name get-windowsautopilotinfocommunity
This new version has options to work with the new Autopilot Device Identifier functionality:
New parameter “-identifier” tells it to use the new functionality and not the hash
Thie can be used with either -online or -outputfile to grab the current device and either add directly to Intune, or export to upload later.
There is also a parameter called “InputFile” to give it an already exported CSV containing one or multiple devices which it will loop through and add.
If the devices exist already, it checks first and tells you.
Of course the script still works with the older functionality as well!
Thank you!
It seems I mistakenly switched the value and secret ID, but it’s working now.
https://prnt.sc/N9LF-al46TAD
How long does it typically take for the device to appear on the portal?
Best regards,
Ranko
Maximum of 30 minutes for a large tenant, it’s usually very quick though
It’s odd that it’s still not showing, especially given the size of the tenant. I’ll wait another 30 minutes to see if anything changes.
In the meantime, is there any way to troubleshoot this if it doesn’t appear on the dashboard?
Are you looking in Autopilot devices for it?
Yes,
https://prnt.sc/oFTLgn-3QzFI
I even tested with a device that had never been added to Intune or Autopilot before, but unfortunately, it’s still not showing up on the portal. 🙁
You could have something blocking enrollment, if you add via CSV does that work?
I couldn’t reply directly to your last comment, so I’m using this one instead.
“It’s possible that something might be blocking enrollment. Have you tried adding the device via CSV? If so, does that work?”
I just tested the process on my laptop without any additional parameters (although I’m a domain admin), and it worked successfully. The only command I used was:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass; C:\Tools\get-windowsautopilotinfocommunity.ps1 -online
After running this, the script was completed in 61 seconds, and the device showed up as expected after refresh.
https://prnt.sc/n7fe5LuEHyH8
So, maybe its something with permission of app:
I add just DeviceManagementServiceConfig.ReadWrite.All
and plan is to add also this to it to see will it work:
DeviceManagementManagedDevices.ReadWrite.All
DeviceManagementConfiguration.ReadWrite.All
User.Read.All
These are the permissions it uses interactively:
Group.ReadWrite.All, Device.ReadWrite.All, DeviceManagementManagedDevices.ReadWrite.All, DeviceManagementServiceConfig.ReadWrite.All, GroupMember.ReadWrite.All
It seems that -identifier is a problem, I’m getting devices if I remove this parameter?
Identifier is for v2 (device prep), without is for v1
I wanted to use V2 … is there any link to find how to troubleshoot this issue?
v2 won’t add devices to Autopilot devices, that’s V1. V2 just adds device identifiers
Hi,
Is it possible to automate this process by running the script from RMM (in my case NinjaOne) on multiple machines without user interaction?
Best regards!
Ranko
Which part in particular? Any of it can be automated
Hi,
First of all, thank you for your quick response!
I am looking to run this script on NinjaOne (NinjaRMM) to enroll all current devices into Autopilot V2 without requiring user interaction. I need the process to be fully automated and not done one by one.
Best regards,
Ranko
Ok, if you create an app reg and secret and then use:
get-windowsautopilotinfocommunity.ps1 -identifier -online -TenantId “TENANT ID HERE” -AppId “CLIENT ID HERE” -AppSecret “CLIENT SECRET HERE”
Thank you so much.
Great, I will try tomorrow morning to test!
Hi Andrew,
Could you please provide me with a “how-to” guide or a link to creating an app? It seems I may not have set the correct permissions for it to work properly.
Best regards,
Ranko
Hi,
Either of these cover it:
https://www.osdeploy.com/guides/autopilot-app-registration
https://scloud.work/autopilot-registration-app/