none
How to get all available recipient e-mail address from office 365 using managed Exchange web services (EWS)? RRS feed

  • Question

  • Hi Team,

    Currently i am getting top 100 list of recipient email addresses using below method.

    var nameResolutionCollection = Exchnageservice.ResolveName("SMTP:");

    But we have more than 100 recipients in my office 365 exchange server.

    Is there any way to get the more than 100 recipient email address using EWS api?

    Thank u in advance.

    Regards,

    Prasad.


    Monday, September 25, 2017 2:13 PM

All replies

  • 100 in the limit with ResolveName, a few workarounds are to use a group and add the user you want to that group then expand the group. getSearchableMailboxes https://msdn.microsoft.com/en-us/library/office/jj900497(v=exchg.150).aspx will return all the Mailboxes, You can use FindPeople http://gsexdev.blogspot.com.au/2013/05/using-ews-findpeople-operation-in.html . 

    But my suggestion would be you use the Graph API https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_list or the People Preview https://msdn.microsoft.com/en-us/office/office365/api/people-rest-operations

    Cheers
    Glen

    Tuesday, September 26, 2017 12:04 AM
  • Hi Glen,

    Thank you so much for your reply.

    i have created one group in office 365 with the group id "admingroup@eala.onmicrosoft.com" and assigned one user(administrator@eala.onmicrosft.com) to the this group, after this configuration i trying to get the users from this group by using getSearchableMailboxes  method, but it returns only the one item in searchablemailbox property ie "admingroup@eala.onmicrosoft.com", this method didn't return the members in this group.

      var response = ExchangeService.GetSearchableMailboxes("admingroup@eala.onmicrosoft.com", true);

    Do i need to do any configuration to get all members in group in exchange online?

    And also according to your suggestion i have tried to use graph api but it needs the Bearer token.

    How do i get the Bearer token for my windows application?

    And also i am currently using the developer office 365 trial account.

    Regards,

    Prasad.



    Tuesday, September 26, 2017 6:28 AM
  • You should be using ExpandGroup https://msdn.microsoft.com/en-us/library/office/dn629392(v=exchg.150).aspx if you want to use the Group method.

    For the Graph API start here https://developer.microsoft.com/en-us/graph/Quick-Start which takes you through everything.


    Tuesday, September 26, 2017 9:33 PM