← Free Scripts | Identity |PowerShell

Add Devices to a Group

Bulk-add devices to an Entra ID group from a list of machine names, skipping any that are already members.

Assigning an app, policy, or update ring to a specific set of machines means putting those machines in a group, and the portal only lets you add them one at a time. For anything past a handful of devices, that is an afternoon of clicking, and the list you were given is almost always a spreadsheet of machine names rather than object IDs.

This script takes that list and does the work. Enter a prefix to narrow the group picker, choose the target group from the resulting list, then pick the file of machine names. Each name is resolved to its Entra ID device object and added to the group, with devices that are already members skipped rather than re-added and any name that does not resolve reported so you can chase it. It prompts for confirmation before making changes, and prints the group’s full membership at the end so you can confirm the result.

Uses the Microsoft Graph PowerShell SDK and asks only for GroupMember.ReadWrite.All and Device.Read.All. The user equivalent is Add Users to a Group.

Download Add-DevicesToGroup.ps1 from the PowerStacks intune-scripts repository:

GitHub
Entra IDMicrosoft GraphGroups

Want simplified Intune reporting?

PowerStacks BI for Intune and App Store for Intune do the heavy lifting, all inside your own tenant, with nothing leaving it.