c# - Get Email Addresses From Exchange Given DirectoryEntry -


I am piping through all the users of our AD environment and reading their email address so that I do not have any other Can be updated in system. I am using the System.DirectoryServices library below. Simplified example What do I know is that the mail attribute is not always correct and it is often missing, though the user Has a valid mailbox setup and functional in exchange. So, the question is that DirectoryEntry is given, instead of reading the mail attribute, to list the user's primary email address (and ideally a surname) from the exchange Any way I have seen something, but they do not look credible either. I am looking for a solution that comes directly from the exchange. No other-and-or-this is their email address about this

directory finder search = new directory finder ("(and (mail = *))"); Search. Page size = 1000; Search.PropertiesToLoad.Add ("Mail"); Finding results in SearchResult Search (FindAll ()) {DirectoryEntry entry = result.GetDirectoryEntry (); Console.WriteLine (. Entry.Properties ["Mail"] Price); }

The exchange does not have a separate data store for this data. If you collect data through an Exchange API (EWS or PowerShell), then you are finally getting the same data. The location of the view in AD is the proxyandressus attribute.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -