I have a SharePoint 2010 Discussion Board and it has many Discussions. Would like to move a discussion from the discussion board to another in the same location (under same site collection).
I managed to move the discussion and changed the author of the discussion from System Account to corresponding user account however could not change the author/editor for the replies
I have used the below PS script to do this.
[void][reflection.assembly]::Loadwithpartialname("Microsoft.SharePoint")
$spsite=[Microsoft.SharePoint.SPSite]("https://Teamssite/")
$spweb = $spsite.openWeb()
$spList = $spweb.Lists["Discussion Board"]
$spItem = $spList.GetItemById(273)
$spUser = $spweb.EnsureUser("myDomain\Userx")
$spItem["Author"]=$spUser
$spItem["Editor"]=$spUser
$spItem.SystemUpdate()
$query=new-object Microsoft.SharePoint.SPQuery
$spFolder = $spItem.Folder;
$query.Query = "";
$query.Folder = $spFolder;
$query.RowLimit = 1;
$spReplies = $spList.GetItems($Query);
$spReply = $spReplies[0]
$spReply["Author"] =$spUser
$spReply["Editor"] =$spUser
$spReply.SystemUpdate()
Still, It is showing the System Account for the replies. What am I missing? Is there any other way of doing it?