What email account is using Outlook?

Valued Contributor II

Sorry if I'm repeating a question previously asked, but here goes.

Moving to Azure AD from on premise has created a challenge since we've completely disconnected our Jamf and AD. Legacy user IDs that were read in the past (ex, Rich Trouton's script here) have become no longer as useful. Now I'm trying to get creative and read the email account actively using Outlook. Has anyone come across a readable key that can be read by defaults (or something else?) that contains the email account being used within Outlook? I can run

defaults read com.microsoft.office OfficeActivationEmailAddress

But there is always the risk that the user who activated Office is not the user using Outlook for email. Generally we should be using the same credential to activate and then use Outlook, but people could slip through.


Contributor III

@easyedc My EA at https://github.com/pbowden-msft/ExtensionAttributes/blob/master/Office365_Logons.xml will give you the UPN of the user who is logged-in to Office 365. You might want to start with that, and modify output formatting as desired.