Access ProxyAddress property of user using GraphServiceClient


  • Hello, I am trying to get list of proxy addresses of an user using GraphServiceClient. I am using 

    Here is the code I am using.
            public async Task<List<string>> GetUserListProxyAddress()
                List<User> userResult = new List<User>();
                List<string> userProxyList = new List<string>();
                GraphClientHelper graphClientHelper = new GraphServiceClient(new AzureAuthenticationProvider());
                IGraphServiceUsersCollectionPage user = await graphServiceClient.Users.Request().GetAsync();
                while (user.NextPageRequest != null)
                    user = await user.NextPageRequest.GetAsync();
                foreach (var userObj in userResult)
                return userProxyList;
    But it gives me an null object reference error, Can anyone please tell me how to get prosy addresses using GraphServiceClient libraries. 

    Friday, March 24, 2017 11:26 PM

All replies

  • Greetigns,

    if you look at the user entity in the Microsoft Graph API:

    the proxyAddresses attribute is read only.  It cannot be changed using any of the REST methods.

    proxyAddresses String collection For example: ["SMTP:", "smtp:"] The any operator is required for filter expressions on multi-valued properties. Read-only, Not nullable. Supports $filter.

    Only think you can do from code is search it.

    MaxV (MSFT)

    Wednesday, March 29, 2017 2:38 PM
  • Another suggestion is to post this question on

    Let me take a look at the code snippet and see if I can figure out why the information is note being returned as expected.

    MaxV (MSFT)

    Wednesday, March 29, 2017 2:41 PM
  • Are you using the GraphClientHelper for the AAD Graph? (Old Graph API.)

    Do you get the expected result if you query instead of The objects and attributes are not identical between the two.

    Wednesday, March 29, 2017 3:45 PM
  • My suggestion is to move to the current version of the GraphClient library and take advantage of the new features in the version 1.6 of the API.  The older versions of the library had multiple problems, not to mention issues using older versions of ADAL and the AAD Graph API itself.

    Moving to the GraphClient library, ProxyAddressses are returned as a collection of strings that are very easy to enumerate.

    If you are interested in a similar example using the GraphClient library, reply on the thread and I'll see if I can locate a simplified example, or perhaps create a developer support azure incident and request information about the samples.  Azure support is very inexpensive and in some scenarios, free.

    MaxV (MSFT)

    Tuesday, April 4, 2017 2:31 PM