Skip to main content

SharePoint 2010 - People Picker that is showing the wrong user profile information

Hi again,

introduction to this issue:  Someone has updated information on their MySite but their details have not propagated through to the People Picker, or any list that shows User Information in it.

Why:  This is due to the User Information List, which is used to supply User Information to all the SharePoint functions that use it.  The User Information List only seems to get updated when a user is first introduced to a Site Collection.  Not even a full Profile Sync will fix it. (You can find the User Information List here: http://[rootsite]/_layouts/people.aspx?MembershipGroupId=0).  This issue has been documented before and done very nicely on Gary's blog here: http://blog.falchionconsulting.com/index.php/2011/12/updating-sharepoint-2010-user-information/

The difference is between Gary's blog post and mine, is that his shows how to get a script to iterate through every Web Application and update specific fields.  Where as I will be showing how to look for a specific field & update it manually.

HOW TO FIX USING POWERSHELL

First get the User ID of the person who is having the issue:

$user = Get-SPUser -Identity 'domain\username' -Web http://sharepointserver
$user.id

Then you need to navigate to the Users details in the User Information List using their user ID you just found.  This code will list all the fields for that user appearing in the User Information List

$web = Get-SPWeb http://SharePointServer
$list = $web.Lists["User Information List"]
$item = $list.GetItemById($user.id)
$list.fields | % {Write-Host "$($_.InternalName) = $($item[$_.InternalName])"}

Now you should have found the field causing the issue, so you can update it like this:

$item["FieldName"] = "  "
$item.SystemUpdate()

Done!  Because this is a manual way of searching for the right fields to update, you will need to do this for every Web Application.

Comments

  1. I tried this and it didn't update anything.

    ReplyDelete
  2. Hi Tony,
    No good. I will try and help you with a few tips below, but if they don't work will require some more detail.

    A few things to check:
    Did you List all the fields again for that user after you ran the SystemUpdate to ensure that the field was updated successfully?
    Where is the outdated profile information appearing on your site?
    Is it only happening on one Web Application?
    Have you ran the Update on every Web Application that you notice the issue on?

    Let me know how you go.

    Thanks,
    Brett

    ReplyDelete
  3. Hi Brett, I know this is a fairly old post, but my company just moved sharepoint to a completely different domain, and I've experienced some residual effects in people picker because of it. The script worked find up to the $item["FieldName"] = " " step. I figured there was something I was missing, and tried it different ways....like this $item[Email]="Jagdish.Kapure@mycompany.com" but get the : Missing or invalid array index expression.
    + CategoryInfo : ParserError: ([:String) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingArrayIndexExpression

    And like this - $item["Email"]="Jagdish.Kapure@mycompany.com"
    [ : Unable to index into an object of type Microsoft.SharePoint.SPListItem.
    At line:1 char:7
    + $item[ <<<< "Email"]="Jagdish.Kapure@mycompany.com"
    + CategoryInfo : InvalidOperation: (Email:String) [], RuntimeException
    + FullyQualifiedErrorId : CannotIndex

    Can you see what I'm doing wrong? Thanks - Rick

    ReplyDelete
    Replies
    1. Hi Rick, I can run a few tests in a day or teo to try and get the same errors as you and see what's happening.

      For the moment, my guess is that when you set the $item variable using the $user.id it hasn't actually grabbed that user profile.

      Double check $item contains a list of all the user properties by just typing $item in its own. It should list like 20 or so user properties from memory including email. If it doesn't, try setting the $item variable by typing the user is number manually .

      Hope that helps, Let me know how you go.

      Delete
  4. Thanks for responding Brett. Yeah, the $item is set fine...it displays all that stuff...ParentList, UID, Web etc. etc.

    ReplyDelete
  5. This worked for the root site in the root site collection in my webapp, but not the other site collections. Can you make any suggestions. I changed my display name as a test to Minnie Mouse and it is showing up everywhere in SharePoint. I changed it back to what it should be and it won't change back. Even the people picker is displaying Minnie Mouse. A tad embarrassing.

    ReplyDelete
    Replies
    1. If I try to access a different site collection by url, it will not accept the userid I obtained for the root site collection. If I ask for the userid in another site collection it comes back as 1, and then errors out when I use 1 as the userid.

      Delete
    2. Hi Carollyn, haha oh very embarrassing! Your userID will be different for every site collection. So you will need to get the correct User ID for each site collection E.g.:

      ##Run the first two lines of code on each site collection:
      $user = Get-SPUser -Identity 'domain\brett' -Web http://root/sitecollection1
      $user.id

      $user = Get-SPUser -Identity 'domain\brett' -Web http://root/sitecollection2
      $user.id


      Delete
  6. Thanks. This helped a lot.
    Fieldnames are case-sensitive.

    rather stupid that running a full profile import would not fix this as well.

    ReplyDelete

Post a Comment

Popular posts from this blog

Export Group Membership From Active Directory Using Power Query

If you need to export a list of staff from an Active Directory Group, follow these steps.  Allows you to gather all the names & usernames of staff in a particular group and save the information into Excel.

Step By Step How To:
Open up Excel > Power Query TabClick From Other Sources > From Active Directory:(In Excel 2016 this is found under: Data Tab > New Query > From Other Sources > From Active Directory) screenshots from Excel 2016 on left, Excel 2010 w/ Power Query Add-on right A popup will ask you to enter your domain name.  It should already be populated with the correct information but if not, input your companies domain name & Click OK:
In the Navigator that opens up, expand your domain tree and double click group:

You should now see a list of all groups in Active Directory in the Power Query Editor:
In order to find & filter for a specific Group, Click the Down-Arrow for the 'distinguishedName' column > Text Filters > Contains...
Type the name…

HP Laserjet 1022 Printer - Can't Print on Windows 10

If you are having trouble getting your laserjet working on Windows 10, here's how I resolved the problem:

Go to Devices & PrintersFind your printer & go to Printer Properties > Advanced TabSet Driver to: HP LaserJet 1022 Class Driver & ApplyIf HP LaserJet 1022 Class Driver is not available.  download from this site: http://support.hp.com/us-en/drivers/selfservice/HP-LaserJet-1000-Printer-series/439424/model/439431Print a test page.


SharePoint Online - Branding with CSS

-----------------------------------------------------------------------------------------
This post is related to a larger group of posts called Migrate SharePoint to Office 365 - Planning & Steps
-----------------------------------------------------------------------------------------

I've gone with a Publishing Site Collection so that I can use the 'Alternate CSS URL' in Site Settings > Master Page.

First off, thanks to the following websites which helped get me started:
http://blog.sharepointexperience.com/2015/02/sptechcon-austin-february-2015/#more-2766http://blog.sharepointexperience.com/2015/01/to-brand-or-not-to-brand/ Here's what the end result will look like (if you have the same fonts):


Now for the CSS...

/* Design By : Brett Randall*/
/*     Design Colours: Greens/Greys/Blues */
/*     Last Modified : 28/02/2017*/
/*     Description: CSS to rebrand SharePoint Online Publishing Site Collection that is using seattle.master */

/* TABLE OF CONTENTS
-- -…