Blog

How to Replace Created by and Modified by user in SharePoint List using powershell

Here is the quick script to replace the created  by and modified by column in SharePoint List. These cannot be directly modified using front end.

$web=get-SPWeb http://yoursite.com/sites/corporate/solutions/templates/
$replacedUser =$web.EnsureUser("domain\user")
$list=$web.Lists["Shared Documents"] //replace your List name
foreach($item in $list.Items)       
{        
   $item["Author"] = $replacedUser   
   $item["Editor"] = $replacedUser   
   $item.update()        
}        
$web.Update()        
$web.dispose()

Leave a Reply

Your email address will not be published. Required fields are marked *