SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a custom phone list that was populated from an Excel spreadsheet. I have to add the email address to this list in SharePoint. How do I query Active Directory for the correct email address for each person?

share|improve this question
Does it need to be put back into the Excel spreadsheet or could you just use user profile synchronization? – Scott Keck-Warren Apr 18 '11 at 13:15
up vote 1 down vote accepted

Does the phone list contain the users account as a field or do you have any other person/group fields defined?

If so, I'd probably create a person/group column set to display email address. Then you just add the person's AD account into the field and it will display their email. You could automate this then by creating a workflow to automatically update that field to the account field on creation.

share|improve this answer
This is what I ended up using. It was the easiest method and I set up a Workflow to populate the data. – sange Apr 18 '11 at 13:42

If the person's phone number is one of the attributes that SharePoint is configured to pull from Active Directory then you can query that information from their user profile. This is not an option if using WSS, however. (sample code)

You could write a console app that would do the AD lookup directly and then populate the field in the list. (sample code)

You could write VBA code in the original Excel file that would do the lookup and popupulate the phone number field prior to import. (Sample code)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.