Update #SharePoint list item author and editor #SP2010 #PowerShell #PS2010 #SSRS

May 1, 2013 at 7:52 am | Posted in Administration, Configuration, Fixes, Functionality, Information, PowerShell, Workarounds | 1 Comment
Tags: , , ,

Recently while working on a client deployment we had an issue relinking the SSRS reports to the data sources within the same library – SSRS was in SharePoint integrated mode. We had developed the Project Server solution internally and migrated it to the clients environment at a later date. All worked as expected apart from trying to relink the SSRS Reports to the updated data sources. The SSRS data sources had been edited to use the correct databases / PSI web services but when we tried to link the reports to the databases from the Manage Data Sources menu, SharePoint threw an error when trying to browse to the data sources. The error from the ULS log can be seen below:

Microsoft.ReportingServices.Diagnostics.Utilities.SharePointException: , Microsoft.ReportingServices.Diagnostics.Utilities.SharePointException: Report Server has encountered a SharePoint error. —> System.NullReferenceException: Object reference not set to an instance of an object.  
at Microsoft.ReportingServices.SharePoint.Objects.RSSPImpUser.get_LoginName()  
at Microsoft.ReportingServices.SharePoint.Utilities.CatalogItemUtilities.GetListItemUserLoginName(RSSPListItem item, String fieldName)

The cause of this error was that the user who created the SSRS objects had been removed from SharePoint when the system was cleaned up to take on to the clients environment.

There is a simple fix, that is to update the Author (Created By) and Editor (Modified By) fields with a user that exists on the SharePoint farm. The Author field can’t be updated via the UI but it can be update via the object model.

I created a simple PowerShell script that will update the author and editor for all SharePoint list items in the chosen list. To download the PowerShell script please see the link below:

http://gallery.technet.microsoft.com/scriptcenter/Update-SharePoint-list-4e6272ab

There are some variables / settings that need to be updated before running the script, these can be found below:

$newuser = "support\paulmather"  This needs to be updated with the new author and editor’s user account.

$site = get-SPWeb http://vm353/pwa/ProjectBICenter This needs to be updated with the correct URL for the site that contains the list / library.

$list = $site.Lists["Test"] This needs to be updated with the name of the correct library / lists that contains the list items that need to be updated, in this example the SSRS items.

That is it, the script is then ready to run.

Please fully test on a replica test farm before running on Production.

Advertisements

1 Comment »

RSS feed for comments on this post. TrackBack URI

  1. […] This article has been cross posted from pwmather.wordpress.com (original article) […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: