Question : Determine Outlook web address URLs from Username

I need to guess the URL to folders in a user's Outlook Web Access given info about the user from Active Diredtory via LDAP.
This sounds simple at first, as it should be
https://(servername)/exchange/(username)/(foldername)
However, I seem to be unable to determine the really working username.
My best guess so far has been the part after "cn=" of the LDAP attribute "legacyExchangeDN".
But I do have a few users where this fails.
These seem to suggest that I should extract the username form some "proxyAdresses", but this does not work relyably for everyone, either.
There must be a "right" thing to do it, I hope!?

Answer : Determine Outlook web address URLs from Username

Question PAQ'd, 500 points refunded, and stored in the solution database.
Random Solutions  
 
programming4us programming4us