I am trying to list a user's shared mailboxes. We have a mixed environment so some are mapped automatically through Exchange, and some are not (security group permissions). I want to add a Powershell script to the login process to record all mailboxes a user has loaded in Outlook. I want to save this list to a text file or csv.
I am able to get the names through $outlook.getnamespace("mapi")
. However some names have changed and the user's Outlook doesn't show those changes, so this name means nothing when thrown at Exchange or AD, however somehow still magically works.
I need something more concrete, samaccountname or smtp address.. something like that.
EDIT
I have continued to work at this, and with the help of MFCMAPI
I was able to determine I need the PR_USER_NAME
property. I need to do this with vanilla Powershell to run on a client system (and I have thousands so installing EMS is not an option).