1

I am using a multiline text field with Append Changes to Existing Text enabled. So everytime I add a new comment it creates a new version with, Created by set to the user who triggered the action.

I want to overwrite Created by a different name using server side code in C#. I tried updating Author and Editor field but that did not help.

I couldn't find a solution on the internet as well.

0

I'm almost positive that Author and Editor are read-only. They can't be updated programmatically.

0

use this script:

Add-PSSnapin Microsoft.SharePoint.PowerShell -EA 0 
#specify new user - login name 
$newuser = "Support\paulmather" 
#specify the web URL 
$site = get-SPWeb http://vm353/pwa/ProjectBICenter 
#specify the list name 
$list = $site.Lists["Test"] 
$listitems = $list.Items 
$user = get-SPuser -Web $site -Identity $newuser 
#loop through each list item and update 
foreach ($listitem in $listitems) 
    { 

        $listitem["Author"] = $user 
        $listitem["Editor"] = $user        
        $listitem.Update() 
        write-host $listitem["Name"] "has been updated. The author and editor has been set to $user" 

    } 
$site.Update() 
$site.Dispose()

Hope it helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.