Hello @CL7 ,
Welcome to Q&A Forum!
According to my research, we cannot keep the values of 'Modified','Modified by', 'Created', 'Created by' and other columns. Because they are defined by SharePoint, SharePoint will automatically obtain and store who created/edited item and when item was created/edited.
You can implement this design through the PowerShell command:
1.Source List: TestList
2.Target List: CopyList
- Create two "Date and Time" columns named "TestListModified" and "Datestamp"
- Set "Datestamp" value is equal NOW()
- Create one "Person or Group" column named "TestListModifiedBy"
3.Please run the following powershell script as an admin:
#Configuration variables
$WebURL = "http://sp/sites/echo"
$SourceListName = "TestList"
$TargetListName= "CopyList"
#Get Objects
$web = Get-SPWeb $WebURL
$SourceList = $web.Lists[$SourceListName]
$TargetList = $web.Lists[$TargetListName]
#Get all source items
$SourceColumns = $sourceList.Fields
$SourceItems = $SourceList.GetItems();
#Iterate through each item and add to target list
Foreach($SourceItem in $SourceItems)
{
write-host -foregroundcolor yellow Copying Item: $SourceItem["Title"]
$TargetItem = $TargetList.AddItem()
$TargetItem["Title"] = $SourceItem["Title"]
$TargetItem["TestListModified"] = $SourceItem["Modified"]
$TargetItem["TestListModifiedBy"] = $SourceItem["Editor"]
$TargetItem.update()
}
4.Go back the CopyList , you can see the below screeshoot:
Thanks,
Echo Du
===================================
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.