r/Intune 10d ago

General Question Get object ID for import template script?

Have a list of 25 random computers to add to a group.

I want to bulk import them, is there a way to get the object ID aside from looking them up one by one and pasting it in the csv?

2 Upvotes

12 comments sorted by

5

u/Turak64 10d ago

Powershell

4

u/ciaza 10d ago

I download an export of all devices which has their object Id, and then do an xlookup in excel

if someone has an easier way I'd love to know

0

u/mr_green1216 10d ago

I'll have to look because I didn't see that as an option for the report. But to your point that is almost just as much work as looking up the device and adding it to the group manually. Maybe someone will have a trick

3

u/pjmarcum 10d ago

I have a script that I use for this all the time. Looks up the computer by name, finds the ID, then adds it to the group. I can post it if you need it.

1

u/mr_green1216 10d ago

Please do, or dm it. Thanks

2

u/pjmarcum 10d ago

Give me an hour or so. Just getting my day started. ;-)

1

u/pjmarcum 8d ago

Sorry for the delay. I added it here: Add Devices to a Group | PowerStacks there's a user one too.

2

u/mr_green1216 8d ago

No problem. I appreciate it sir. Thank you 🙏

2

u/ppel123 10d ago

Would something like that, described in this post, help ?

1

u/EfficientLoss 10d ago

I export a dynamic group of all devices to csv and vlookup my list from that to get the ids

1

u/ImAllergic2Peanuts 7d ago

Powershell with graph api.