How can we take the user's details from active directory in SharePoint 2010. I have one requirement, which has the functionality to send the mail to all the users who are listed in particular column in share point list. These column has the type of Single line of text (displaying display-name of the User). I need to retrieve each users information from AD by passing this display name without adding any LDAP connection string anywhere. Is it possible? if it possible, please help me to sort out this issue.
-
I want to help you out but I've only tried getting the user's details from AD in VB6. :D– Lester NublaCommented Dec 27, 2013 at 8:47
-
1Can you really be sure that the Display Name if a user in AD is unique? Would it not be much better to use a people field in the list, that way your users can enter users almost like today (but with suggestions) and you can uniquely identify the added user by its full login name?– Robert LindgrenCommented Dec 27, 2013 at 9:42
-
1Have you looked at the User Profile Sync service? You can synchronize the users to SharePoint. technet.microsoft.com/en-us/library/ee662538.aspx– Frank HCommented Dec 27, 2013 at 9:58
1 Answer
SharePoint has user profile synchronization service. It allows to sync AD user details with SharePoint user profile. You can configure mapping between attributes in AD and user profile properties. Once you configured syncronization you can access properties of users.
If you need only send email, I guess it can work without syncronization, just by user.
If you have SharePoint list I would recommend to use User or group to store list of names. It stores ids of users, but displays names.
You can access this field value and send email using workflow or SPUtility SendMail method if you develop server side code. Both of them doesn't require specifying email addresses, they send emails by user. I assume they get information directly from user.