Forum Discussion
moinkhanengr
Sep 16, 2025Copper Contributor
Retrieving Entra ID email address from macOS devices in system context
Dear Team, We are working on retrieving email address of the user joined to Entra ID from Entra-joined macOS devices, specifically while running in a system context. The sudo dscl . -read /Users/...
Sep 25, 2025
hi moinkhanengr On macOS Entra-joined devices, there’s no direct system-context command to pull the user’s Entra email. A few workarounds:
Enterprise SSO plug-in → parse the cached token (JWT) to read the preferred_username (email).
Intune / Graph API → pull the “Primary User” UPN from the device record instead of locally.
Login script workaround → capture the UPN at user sign-in and store it (e.g., /var/tmp/entra_upn.txt) for later system use.
For immediate needs, the login-script approach is the most reliable.
Sep 26, 2025
hi moinkhanengr kindly close the thread if you are not looking for further info. thank you