EnterpriseIdentity

Entra ID on macOS

Use Microsoft Entra ID users with DefenseClaw on a Mac with Platform SSO, and carry Entra group membership in a local group with a bridge script.

Platform SSO with the Microsoft Enterprise SSO plug-in (Company Portal) signs Entra users in at the macOS login window and links each local account to its Entra user. DefenseClaw reads that link. Entra ID support is Preview.

What DefenseClaw sees

InstallDirectoryPrincipalGroups
Standalone enterpriseentra_id, source macos_platform_ssoThe Entra UPN, so a users assignment by UPN worksLocal groups only
Per-userlocalNone: a per-user install cannot read the linkLocal groups only

Platform SSO stores each registered account's UPN in its record (AltSecurityIdentities, PlatformSSO:<upn>), which the standalone enterprise enumerator reads as root. Accounts that never registered stay local.

No Entra group reaches the macOS group database. id -Gn lists only local groups, and dsmemberutil checkmembership does not find the Entra group. With UserAuthorizationMode and NewUserAuthorizationMode set to Groups and AdditionalGroups naming Entra groups, or with AdministratorGroups, Platform SSO creates empty local groups (gid 5000 and up) and never adds the user. So a groups assignment can match only a local group that carries the membership.

Before you start

  • Macs enrolled in Intune with Platform SSO and Company Portal. The settings catalog body is macos-platform-sso.settings-catalog.example.json in the starter kit.
  • macos-entra-group-bridge.sh from the same kit, for group-based profiles.
  • A new Platform SSO account can enter the full macOS Setup Assistant at first login. Sign users in once before they need the Mac, or deploy an approved Setup Assistant skip payload.

Carry an Entra group in a local group

Add a user on one Mac

macos-entra-group-bridge.sh adds the signed-in user to a local group, or removes them. It uses the group Platform SSO created when one of that name exists:

sudo ./macos-entra-group-bridge.sh add --group ml-team --user alice
sudo ./macos-entra-group-bridge.sh add --group ml-team --user alice --apply
./macos-entra-group-bridge.sh check --group ml-team --user alice

The script refuses built-in and privileged groups (admin, wheel, staff, com.apple.*, any group with an id below 500) unless you pass --allow-system-group (ALLOW_SYSTEM_GROUP=yes).

Deliver it with Intune

For a fleet, let Intune decide who is in the group. This works with one signed-in Entra user per Mac, who is also the Mac's primary user. Intune runs the script as root, not as that user, so each copy names the account:

  1. Fill in the settings block of a copy (ACTION=add, GROUP_NAME=ml-team, USER_NAME=<the Mac account of the Entra user>, APPLY=yes) and assign it to the Entra group.
  2. Assign a copy with ACTION=remove to the users who are not in it (all users, with the Entra group excluded).
  3. Set Script frequency for both copies (for example, daily) and Max number of times to retry if script fails for the add copy (for example, 3). The defaults run each copy once and never retry. See Microsoft's macOS shell script settings.

How a copy behaves:

CaseResult
No USER_NAMEStops with exit 2
add, the named account is in front at the consoleAdds the account
add, another user in front, or the login window showingChanges nothing, exits 1

Delivery through Intune is Preview.

Map and check

Assign the profile to the local group, as in Map users and groups to profiles. A member gets the group profile on a per-user install and on standalone enterprise; another user gets default_profile. Removing the membership moves the member back to the default.

Check after sign-in with the script result, the local group membership and Check. If the user was never in front during a run, rerun the copy.

Undo

remove takes the user out of the group and leaves the group in place. Delete the group with dseditgroup -o delete <group> when no assignment uses it.

Troubleshooting

Identity problems and their fixes are in Troubleshooting: Entra ID on macOS.