Search code examples
exchangewebservicespowershell-3.0

How do I get my username for Exchange with PowerShell


Is there any command, or other way, that I can get the username that I have used for logging in to the Exchange-module in PowerShell?

For clarification: This functionality is to be used in a script that will handle permissions for a group of Exchange-admins. And to avoid having to type their admin-accountnames each time they run the script, it would be great if the script could get the name of the account they used when logging in with the PowerShell Exchange-module.


Solution

  • I never found an clear answer for this, so I insteed used my domain-AD username to search for correct useraccount.