Try to use Get-WindowsAutopilotInfoCommunity.ps1
It is updated script to use MSGraph and supports GroupTag creation.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Dears,
I would like to use script to add GroupTag to Autopilot by Serial Number, The scrip as the below:
**Connect-MgGraph
$SNs= Import-Csv "C:\NoGroupTag_Serial.csv"
foreach($SN in $SNs){
$currentdevice= Get-AutopilotDevice -Serial $SN
Set-AutopilotDevice -id $id -groupTag "ABC"
}**
However, It always got the error: **Get-AutopilotDevice : Microsoft.Graph.PowerShell.Authentication.Helpers.HttpResponseException: Response status code does not indicate success: BadRequest (Bad Request). System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord) Path C:\Add_GroupTag_by_SerialNumber.ps1:5 char: 17
If I execute the script individually by line, the success result will get. Not sure what reason system cannot recognize the value of $SN or $id. I am appreciated for your suggestion.
Try to use Get-WindowsAutopilotInfoCommunity.ps1
It is updated script to use MSGraph and supports GroupTag creation.