简体   繁体   中英

How to get company by user email from Active Directory?

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.

https://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.contact.companies(v=exchg.80).aspx

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM