Skip to main content
KBY Technologies Logo

Design Defender for Endpoint Device Groups: Tag-Based Matching, Ranking and Safe Changes

Use tags and ranked device groups in Defender for Endpoint so each team sees only its devices, and change groups without losing notification rules.

A diverse group of professionals collaborating in a modern office setting, working on laptops around a table.

Underlined words are defined in the KBY Lexicon. Tap or click one to see what it means.

To give each security team the right devices in for Endpoint, label devices with tags, build a short list of device groups whose rules match those tags, and rank the groups so the most specific one comes first. A device joins only the highest-ranked group it matches, and any device that matches none lands in the default Ungrouped devices group.

The constraint to plan around: a device group with no Microsoft Entra user group assigned is open to every user with portal access, and a deleted group can remove email notification rules that referenced it.

#Why it matters: device groups decide who sees what

Microsoft’s documentation lists three jobs for device groups. They limit access to alerts and data to specific Microsoft Entra user groups that hold RBAC roles, they set different auto-remediation settings for different sets of devices, and they let you filter the Devices list during an investigation.

That makes the group a security boundary as well as a filter. A badly ranked rule does not just clutter a list; it can put a server in front of the wrong team, or hide it from the team that owns it.

Defender for Endpoint RBAC follows a tiered model in larger organisations. Microsoft describes a local team that triages alerts in its own location, a regional team that sees all devices in its region and takes remediation actions, and a global team that can see and do everything. Device groups, combined with Entra user groups, are the documented way to limit what each team sees.

Device group creation is supported in Defender for Endpoint Plan 1 and Plan 2. Defender for Business manages groups differently and is outside the scope here. New Defender for Endpoint customers since 16 February 2025 get Unified RBAC only, so check which permission model your tenant uses before you plan the access side.

#How the pieces fit together: tags, rules and rank

Device targeting happens in two stages. First, tags label devices with business context. Then device groups use matching rules, often built on those tags, to decide membership.

  • Tags can be added manually in the portal, by dynamic rules in Asset Rule Management, by a registry key on Windows, by security settings management or configuration profiles on and , by a custom Intune profile on Windows 10 or later, and by app configuration policies on iOS and Android.
  • Matching rules can use the device name, domain, tags and OS platform. A device must satisfy all the conditions you set.
  • Rank orders the groups. Rank 1 is highest, and a device that matches several groups is added only to the highest-ranked one.
  • Ungrouped devices is the default group for everything else. You cannot delete it or change its rank, but you can change its remediation level and the Entra user groups that can access it.

Inside a single condition type, extra rows act as an OR, so one group can cover several tags, device names or domains. You can add up to 10 rows for each property type, and a tenant can hold up to 2,000 device groups.

Loading diagram...

The diagram shows the consequence that catches teams out. Order is the design. A broad rule ranked above a narrow one swallows the devices the narrow rule was written for, and the narrow group stays empty.

#Setting up a tag-driven group design

Start with the smallest set of tags that expresses who should see a device. Resist one tag per project; every tag you add is something another admin has to understand when a device lands in the wrong place.

Networking cables plugged into a patch panel, showcasing data center connectivity.
Photo by Brett Sayles on Pexels

#
Choose how each tag is applied

The method matters because the methods behave differently. Dynamic tags update approximately every hour. A registry-based tag on Windows supports only one tag, syncs once a day, and takes effect sooner if the device restarts. Tags set through the portal appear in the portal list, but tags created from client devices do not.

  1. Decide the tag names and write them down, for example one for server role and one for site. These names are your own convention; Microsoft does not prescribe any.
  2. For Windows devices that need a tag before anyone can reach the portal, use the Intune custom profile with the OMA-URI ./Device/Vendor/MSFT/WindowsAdvancedThreatProtection/DeviceTagging/Group and the data type String.
  3. For tags that follow device properties, create a dynamic rule in Asset Rule Management, which adds and removes the tag automatically.
  4. Avoid parentheses and commas in tag names. Microsoft notes that filtering might not work on tag names that contain them.

Following along? Tap a step’s number to tick it off.

The registry value is Group under HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Advanced Threat Protection\DeviceTagging\, as a REG_SZ of up to 200 characters. To remove the tag, clear the value data rather than deleting the key. Because tags set through other methods are never written to that value, the registry cannot tell you every tag a device carries.

#
Create the groups, narrowest first

Before you start, make sure the Entra user groups you plan to assign already hold RBAC roles, because only those can be granted access. Then work through the wizard in the Microsoft Defender portal under Settings, Endpoints, Permissions, Device groups.

  1. Select Add device group and give it a unique, descriptive name.
  2. Choose the remediation level. Note that Microsoft’s automation levels page says automated investigation and response stops running as a separate experience from 1 September 2026 and that its detection and response are included in the default antivirus stack. Pick the level deliberately, and read that page before relying on it as a control.
  3. On the Devices page, set the matching rule. Prefer tags over device names where you can, so a rule does not depend on a naming pattern.
  4. On the Preview devices page, select Show preview. It shows up to 10 matching devices, so treat it as a sanity check rather than a count.
  5. On the User access page, assign the Entra user group for the team that owns these devices. Leaving it empty makes the group accessible to all users.
  6. Submit, then move the group to the right rank. Put the most specific groups at the top and the catch-all last.

Once the groups exist, the same tags can target other controls. Microsoft lists attack surface reduction rules among them, so a tidy tag scheme pays off again when you roll out Defender attack surface reduction rules from audit to block in stages. The same applies to auditing antivirus exclusions by team.

#Verify that devices landed where you meant

Changes can take up to several minutes to apply, and in some environments several hours. New groups might not appear as filter options under Assets, Devices for hours after creation, so do not judge the result straight away.

The DeviceInfo table in advanced hunting records each device’s group and tags. Its MachineGroup column holds the group that RBAC uses to decide access, and DeviceManualTags and DeviceDynamicTags hold the tags from the portal or API and from dynamic rules.

1DeviceInfo
2| summarize arg_max(Timestamp, *) by DeviceId
3| project DeviceName, OSPlatform, MachineGroup, DeviceManualTags, DeviceDynamicTags
4| order by MachineGroup asc, DeviceName asc

This query is read-only. It returns one row per device with its latest recorded group and tags. Compare it with your tag list: each device carrying a team tag should show that team’s group, and devices with no matching tag should fall into the default group. Confirm what value the column shows for that default group in your tenant.

1DeviceInfo
2| summarize arg_max(Timestamp, *) by DeviceId
3| summarize Devices = count() by MachineGroup
4| order by Devices desc

A group with zero devices after the propagation window is a warning sign. It usually means a higher-ranked group is capturing its devices, or its rule requires a condition that no device satisfies.

A diverse group of professionals working together in a modern conference room with laptops.
Photo by Christina Morillo on Pexels

#What goes wrong when groups overlap

  • A narrow group stays empty. A broader group ranks above it and matches first. Move the narrow group up, then re-run the count query once changes have propagated.
  • A device is in the wrong team’s view. The rule matched on a name or domain pattern that is wider than intended. Add a tag condition so the rule needs both.
  • Everyone can see a group. No Entra user group was assigned. Assign one on the User access page.
  • A tag is missing on a Windows device. Registry tags sync once a day and support one tag. Restart the device for an immediate sync, or move the tag to dynamic rules or an Intune profile.
  • A device never appears at all. A rule cannot match a device that never reports, so check onboarding first with the guide to a Defender for Endpoint device stuck onboarding or inactive.

#Access control and least privilege

Microsoft recommends roles with the fewest permissions, and describes Global Administrator as a highly privileged role to keep for emergencies. Defender for Endpoint’s own Global Administrator role has unrestricted access to all devices regardless of device group or Entra group assignment, so keep the number of people holding it small.

Turning on RBAC for the first time has consequences. Users with read-only access, such as those in the Entra Security Reader role, lose access until they are assigned to a role, and you cannot revert to the initial roles afterwards. Have the right Entra groups ready and an administrator role in place first, or you risk locking people out of the portal.

Creating device groups needs the Security Administrator role. Dynamic tags need permissions in Asset Rule Management, and manual tags need device-level permissions in the portal.

#How to roll back a group change

Portal group changes are not commands, so the safety comes from what you record beforehand. Treat each edit as a change with a stop condition.

  1. Before editing, write down each group’s name, rule, rank, remediation level and assigned Entra groups. Screenshots of the Device groups tab are enough.
  2. Check the email notification rules that name each group. Deleting a group removes it from those rules, and if it was the only group in a rule, the whole rule is deleted along with it. The documentation does not describe an automatic restore, so you need this record to rebuild the rule.
  3. Prefer changing a rank or rule over deleting a group. Both can be reversed by setting the old values back.
  4. If the count query shows devices in an unexpected group after the propagation window, restore the recorded rank and rule, wait for propagation, and run the query again.
  5. Delete a group only after its devices appear in the group you intended and its notification rules have been recreated against the new group.

#Operational checks before you rely on the groups

Run through these after any change, and again after a tag method changes.

  • The group count query shows every group you expect, with plausible device numbers.
  • Every group has an Entra user group assigned, or an owner has accepted that it is open to all portal users.
  • The catch-all rule is ranked last, and the Ungrouped devices group holds only devices you have accepted.
  • Each email notification rule still lists the groups it should.

The next safe decision depends on the result. If the checks pass, extend the same tags to other controls one at a time. If they fail, fix rank and rule first, because changing what a group is allowed to do while its membership is wrong only spreads the mistake. Confirm version-specific behaviour on the Microsoft Learn device group page before you apply the change.

About this page

Credited to

Dates

Published

Sources

This page lists no external sources.

Corrections

No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.

Found this useful? Follow KBY for more like it.

Reader Interaction

Comments

Add a thoughtful note on Design Defender for Endpoint Device Groups: Tag-Based Matching, Ranking and Safe Changes. Comments are checked for spam and held for moderation before appearing.

Loading comments...

More from KBY that goes with this article.

Discover more

Lexicon Definitions

Was this useful?

Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.

Engineering insights, direct to you.

Receive the latest Systems Engineering tutorials, production guides, Engineering Labs and operational best practices.