'Getting username from Outlook app in Bash on MacOS devices
I'm having an issue where I'm writing a Bash script, and I need it to retrieve the current User Principal Name used with Outlook or Mail account to send emails.
Script needs to configure a an app that changes behavior based on the user that logs into it. No password is needed, just the UPN used with emails.
If I use
userName -string "$(whoami)@INSERTYOUREMAILDOMAIN.COM"
result: [email protected]
I only get the local user profile name, which is not the desired result. Can I retrieve the UPN used with Outlook or Mail apps?
Basically, get the Office 365 user ID
In Windows it's very simple.
whoami /upn
I'm not really used to working with MacOS in general, so it's not as handy as Powershell, or I may be missing something :/
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
