none
Fetching Mailbox Usage Location using Exchange Web Services (EWS) RRS feed

  • Question

  • Hi,

    I need to obtain a mailbox user's Usage Location via EWS.

    How do I get that. I know how to obtain it using Powershell.

    But I can make use of EWS only to get the location.

    I am using GetSearchableMailboxes EWS api to fetch other mailbox details.

    Regards,

    Gagan


    Gagan

    Tuesday, February 25, 2014 10:05 AM

All replies

  • That property is not exposed directly via EWS or Autodiscover however when you do set it this should modify the Country Setting on the User object. So one way to get this is use the ResolveName operation and look at the Country setting of the business Address eg

                NameResolutionCollection ncCol = svc.ResolveName("user@doman.onmicrosoft.com", ResolveNameSearchLocation.DirectoryOnly, true, new PropertySet(BasePropertySet.FirstClassProperties));
                if (ncCol.Count ==1) {
                    if (ncCol[0].Contact.PhysicalAddresses[PhysicalAddressKey.Business] != null) {
                        Console.WriteLine(ncCol[0].Contact.PhysicalAddresses[PhysicalAddressKey.Business].CountryOrRegion);
                    }
                }

    Cheers
    Glen

    Wednesday, February 26, 2014 3:47 AM