Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a web app that uses FBA and LDAP (Active Directory). Users are able to login to the site without any issue. As part of on boarding process, users are redirected to their mysite "edit profile" page where they have to fill in some basic info. The issues on this page:

  • Name property is automatically filled out as i:0#.f|ldapmember|test@test.com
  • Work Email is not automatically filled out

During debugging I noticed, user's my settings page (/_layouts/userdisp.aspx?Force=True), show email address as their "name" and "work email" is also set to email address. This is valid for short period of time until the user profile to site sync timer job runs and then the values get updated according to their user profile.

My question is how can I:

  • Automatically set a user's Name profile property to their name in AD (Smith, John)
  • Set their Work Email to their email address

Also, I don't want to setup UPS for this web app as the requirement is to allow users to update their information.

Following is the ldap configuration

<add name="LdapMember" 
    type="Microsoft.Office.Server.Security.LdapMembershipProvider, Microsoft.Office.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" 
    server="xxxx.xxxx.com" 
    port="389" useSSL="false" 
    userDNAttribute="distinguishedName" 
    userNameAttribute="userPrincipalName" 
    userContainer="dc=xxxx,dc=com" 
    userObjectClass="person" 
    userFilter="(ObjectClass=person)" 
    scope="Subtree" 
    otherRequiredUserAttributes="sn,givenname,cn" />

Thanks and any help will be appreciated.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I couldn't find a way to get those user profile property populated automatically, so I went with a custom development approach where on the first login to the site the current user's profile is create programmatically using the following code:

private static void CreateProfile(UserProfileManager upm, SPUser user) {
        var profile = upm.CreateUserProfile(user.LoginName);
        profile.DisplayName = user.Email;
        profile[PropertyConstants.WorkEmail].Value = user.Email;
        profile.Commit();
}

For now I am filling in the user's display name as their email because that is readily available but I could get their full name from AD...

share|improve this answer

Your Answer

 
discard

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.