How to get company by user email from Active Directory?
I use Microsoft.Exchange.WebServices.
private const ExchangeVersion ExchangeVersion = Microsoft.Exchange.WebServices.Data.ExchangeVersion.Exchange2007_SP1;
//...
_exchangeService = new ExchangeService(ExchangeVersion);
var collection = _exchangeService.ResolveName(userEmail);
It gives me one object with MailBox item (with proper email address) and Contact = null.
ResolveName() returns NameResolutionCollection, NameResolution has a Contact property, the Contact property has collection of Companies.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.