Powershell script to copy column items for one column to another column within the list


In this post, we will discuss powershell script to copy column items from one column to another column within the list in SharePoint 2010.

PowerShell script for copying column items for one column to another within the list:

Add-PSSnapin Microsoft.Sharepoint.Powershell
[System.reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”)
$site = new-object Microsoft.SharePoint.SPSite(“SiteURL”)

$web = Get-SPWeb -Identity siteURL

$lista =$web.Lists[“ListName”]

$items = $lista.items

foreach ($item in $items) {
$user = $item[“Source column”]
write-host $useracc

$useracc = $web.EnsureUser( $user);

$item[“Desination column”] = $useracc

write-host $useracc

$item.update()
}

$lista.update()


Read some SharePoint 2013 tutorials:

Hope this will work!!!


You May Also like the Following SharePoint Online Tutorials:

Leave a Reply