I wrote the following script to update the created by column of the documents in one of my document libraries:
Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue
$SPWeb = Get-SPWeb "";
$SPList = $SPWeb.Lists[""]
$userName = "";
$user = Get-SPUser -web $SPWeb -Identity $userName;
$userString = "{0};#{1}" -f $user.ID, $user.UserLogin.Tostring()
$SPListItemCollection = $SPList.Items
foreach ($ListItem in $SPListItemCollection)
{
$ListItem["Author"] = $userString;
$ListItem.UpdateOverwriteVersion()
}
The script runs successfully but when viewing the metadata from the browser I noticed the values don't get updated
Any ideas ?