Reputation: 535
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.
Upvotes: 2
Views: 72
Reputation: 1471
ResolveName() returns NameResolutionCollection, NameResolution has a Contact property, the Contact property has collection of Companies.
Upvotes: 1