Forum Discussion

moinkhanengr's avatar
moinkhanengr
Copper Contributor
Aug 11, 2025
Solved

Fetch Email of Login User In System Context

Dear Team, We are working on retrieving email address of the user joined to Entra ID from Entra-joined Windows devices, specifically while running in a system context.The whoami /upn command succe...
  • Harm_Veenstra's avatar
    Aug 12, 2025

    It's in the registry beneath the Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CloudDomainJoin\JoinInfo key; you could query it using:

    (Get-ChildItem HKLM:\SYSTEM\CurrentControlSet\Control\CloudDomainJoin\JoinInfo -Recurse).GetValue('UserEmail')

     

Resources