SysManSquad / sysmansquadblog

1 stars 3 forks source link

Bulk Updating Autopilot enrolled devices with Graph API and assigning a Group Tag based on Purchase OrderID-SysManSquad | Systems Management Squad #27

Open utterances-bot opened 1 month ago

utterances-bot commented 1 month ago

Bulk Updating Autopilot enrolled devices with Graph API and assigning a Group Tag based on Purchase OrderID-SysManSquad | Systems Management Squad

A community blog and subsidiary of WinAdmins.io

https://sysmansquad.com/2020/08/24/bulk-updating-autopilot-enrolled-devices-with-graph-api-and-assigning-a-group-tag-based-on-purchase-orderid/

TheGrumpyTechnician commented 1 month ago

Hi Jake! love this write up and the video but I would like to modify it a bit. Instead of calling for purchaseID's. could we perhaps bulk update set serial numbers from a TXT file? your teams script is the only one that has worked so far but we are having difficulties narrowing it down to a set group of serial numbers (without the purchase ID). if any help can be provided I would greatly appreciate it! thank you

MLConian commented 1 week ago

@TheGrumpyTechnician - I had a similar issue with this script, as I needed to get devices from an AzureAD group. I ended up doing this with a CSV export of both the AAD group (only the DeviceID) and all AutoPilot devices (id and AzureActiveDirectoryDeviceId), then cross-referencing the DeviceID and AzureActiveDirectoryDeviceId with an X.SEARCH in Excel, pausing the script after both exports. The X.SEARCH then resulted in the related id from the list of AP devices, which I then copied to a separate CSV, which I imported as the $devices variable. That way, I simply enter the group tag and AAD group name at the top of the script, do some filtering by hand (it didn't work automated yet, so it's a workaround), and in the end all members of that AAD group get the tag. You might want to do something similar, add the serialnumbers to a CSV that you import as a variable instead of $purchaseOrderId, and then have $devices defined as $ devices = ($data.value | where serialNumber -in $importedcsv).id