I want to get all users from Exchange server, I don't want to get user's contacts. In fact, I want to get all AD users as Active Directory which we can't connect to.
mExchangeService.ImpersonatedUserId = new ImpersonatedUserId
{
Id = "[email protected]",
IdType = ConnectingIdType.SmtpAddress
};
var contacts = _mExchangeService.FindItems(new FolderId(WellKnownFolderName.Contacts),new ItemView(1000));
I can above code to get user's contact, but that's not I want, I want use a service account to get all Exchange web service users.