locked
Display Name in Sharepoint FBA website RRS feed

  • Question

  • HI I have a FBA site in Sharepoint 2010.

    I used following command to set display User Name at the right top corner of website. Previously it was displaying some junks like

    0#.f|providername|Userid.

     

    The command used is

    Set-SPUser "0#.f|providername|Userid" -Web http://SiteName -DisplayName "USer Name" 

     

    After this i got my Username displayed at right top corner. But after some times it shows the junk instead of Username.

    Any idea?


    Ravi.S Chennai, Tamil Nadu, India
    • Changed type Clayton Cobb Tuesday, June 21, 2011 5:44 AM Always use the Question Type
    Tuesday, June 7, 2011 5:15 AM

Answers

  • Ravi.  I had this problem.  The solution seemed to be to run spweb.ensure user for the root site of the site collection(s) for each FBA user.

    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.ensureuser.aspx

    Either build this into your user creation or a powershell script that runs this .NET code.

    Not sure why it happens but I needed to do the above to put the users into groups and then this problem dissappeared.

     

     

    • Marked as answer by Ravi Subbiah Wednesday, June 22, 2011 5:08 AM
    Thursday, June 16, 2011 10:19 AM

All replies

  • Ravi.  I had this problem.  The solution seemed to be to run spweb.ensure user for the root site of the site collection(s) for each FBA user.

    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.ensureuser.aspx

    Either build this into your user creation or a powershell script that runs this .NET code.

    Not sure why it happens but I needed to do the above to put the users into groups and then this problem dissappeared.

     

     

    • Marked as answer by Ravi Subbiah Wednesday, June 22, 2011 5:08 AM
    Thursday, June 16, 2011 10:19 AM
  • Hi Ravi,

     

    Just check whether have you configure web.config of SSP for FBA... if yes , then remove configuration and check.

    Let me know if you still have issues

     

    Thanks

    Kshitij

    Thursday, June 16, 2011 10:23 AM
  • HI Kshitijb, May i know what is SSP?
    Ravi.S Chennai, Tamil Nadu, India
    Tuesday, June 21, 2011 5:30 AM
  • SSP stands for Shared Service Provider.

     

    Thanks,

    Kshitij

     

     

    Monday, June 27, 2011 10:18 AM
  • I have 1000+ users whose display names needs to be from funky username (0#.f|providername|Userid) to proper display name. How do I do this?
    shobsva
    Friday, October 28, 2011 11:00 PM
  • This code will fix all users in the farm

     

    # function to clean the username
    function CleanUsername($userloginname)
    {
        $userarray = $userloginname.Split("|");
        return $userarray[$userarray.GetUpperBound(0)].TrimEnd();
    }


    # function to get all the site collections in the farm
    function FixFBAUserNames_Farm()
    {
        $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
        $websvcs = $farm.Services | where -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]}
        $webapps = @()

        foreach ($websvc in $websvcs)
        {
         foreach ($webapp in $websvc.WebApplications)
         {
           foreach ($site in $webapp.Sites)
          {
                     FixFBAUserNames_Site $site.Url
          }

            }
        }
    }


    Function FixFBAUserNames_Site($SiteURL)
    {
     $site = New-Object Microsoft.SharePoint.SPSite($SiteURL) ;
     $web = $site.OpenWeb();
        $users = $web.AllUsers
        foreach ($user in $users)
        {
            if ($user.Name.ToString().Contains("|"))
            {
                Write-Host "Progress : Fixing " $user.Name
                $user.Name = CleanUsername $user.Name.ToString();
                $user.Update();
            }           
        }

        $web.Dispose();
        $site.Dispose();

     

    }


    FixFBAUserNames_Farm

    Tuesday, January 17, 2012 9:44 AM