in

Dot Net Mafia

Group site for developer blogs dealing with (usually) .NET, SharePoint 2013, SharePoint 2010, Office 365, SharePoint Online, and other Microsoft products, as well as some discussion of general programming related concepts.

This Blog

Syndication

Archives

Corey Roth [MVP]

A SharePoint MVP bringing you the latest time saving tips for SharePoint 2013, Office 365 / SharePoint Online and Visual Studio 2013.

Error: Update-SPProfilePhotoStore : Object reference not set to an instance of an object

I like blogging about errors and their resolutions.  Sometimes the answer is simple, but I think there is a lot of value in posting the details of an error so that users can find answers in the search engines.  After doing a My Sites upgrade from SharePoint 2007, you will have a whole heap of user photos that you need to beat into submission.  This command goes through all of the existing user photos and creates thumbnails.  This is often useful when a user has uploaded a giant image of themselves and you need to fix it.  To do this, you may be familiar with the PowerShell command Update-SPProfilePhotoStore.  You call it by passing the URL to your My Sites host.

Update-SPProfilePhotoStore http://mysitehosturl

If you don’t have the right permissions, you will find yourself with the following error:

Update-SPProfilePhotoStore : Object reference not set to an instance of an object.
At line:1 char:27
+ Update-SPProfilePhotoStore <<<<  -MySiteHostLocation
http://mysites
    + CategoryInfo          : InvalidData: (Microsoft.Offic...ofilePhotoStore:
   SPCmdletUserProfilePhotoStore) [Update-SPProfilePhotoStore], NullReference
  Exception
    + FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell.
   SPCmdletUserProfilePhotoStore

UpdateSPProfilePhotoStoreError

Now clearly to you that means you don’t have the right permissions, correct?  Of course not.  To run this command, you need the permissions as defined in this post on MSDN blogs.  Now, you could take the easy way out and just run PowerShell as the farm account.  However, I know you know better.  Just go set up the right permissions and you’ll be set.  The post on MSDN summarizes them as follows:

  • Go to Service Applications, select your User Profile Service Application, and then click Permissions.  Add your account and check the Full Control checkbox.
  • Select the User Profile Service Application, and then click the Administrators button.  Add your account there and check the Manage Profiles checkbox and nothing else.

Note that you can add groups on the Administrators section but you can’t on the Permissions section.  Once you do that, run PowerShell with the Run as Administrator option and run Update-SPProfile again.  It should execute without an object reference error.

Comments

 

Thumbnail Migration « Sladescross's Blog said:

Pingback from  Thumbnail Migration &laquo; Sladescross&#039;s Blog

May 3, 2012 2:46 AM
 

Adam said:

Great article, worked a treat.. Thanks!!

August 12, 2012 6:04 PM

Leave a Comment

(required)  
(optional)
(required)  
Add

About CoreyRoth

Corey Roth is an independent SharePoint consultant specializing in ECM, Apps, and Search.
2015 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems