1

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?

1
  • Does it need to be put back into the Excel spreadsheet or could you just use user profile synchronization? Commented Apr 18, 2011 at 13:15

2 Answers 2

1

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.

1
  • This is what I ended up using. It was the easiest method and I set up a Workflow to populate the data.
    – sange
    Commented Apr 18, 2011 at 13:42
1

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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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