0

I'd like to request help with the following problems:

Using: c#, Microsoft.Exchange.WebServices, ExchangeServer 2013 SP1

  1. Is it possible to get id of GAL by the use of c# + Microsoft.Exchange.WebServices ? The only possibility I have found is that I need to use "the Get-GlobalAddressList cmdlet https://technet.microsoft.com/en-us/library/aa996579(v=exchg.160).aspx in Exchange Management Shell.

I'd prefer to retrieve it via c#, but I cannot find any information regarding it.

  1. Querying GAL - retrieving all the items. Making the research I found 2 ways - methods which are helpful:

a) service.ResolveName - works after some minor tweaks b) service. FindPeople - not tested as I do not have id of GAL. Can someone tell me if this is better than "a" and provide maybe exmaple of use in c#

Are there any other ways to get all the items from GAL ? Any links for tutorials, articles or code examples?

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Luqpa
  • 47
  • 1
  • 2

1 Answers1

1

If its OnPrem Exchange you can just query active directory directly using LDAP https://www.c-sharpcorner.com/article/accessing-global-address-list-via-system-directoryservices-n/ . You can't get the GAL's Id using the EWS managed API you can use the Offline address book https://gsexdev.blogspot.com/2013/06/ews-findpeople-workaround-for-reading.html. If its Office365 then the Graph API would be a better option.

Glen Scales
  • 20,495
  • 1
  • 20
  • 23