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.


New to Office 365 SharePoint Online? Get Office 365 Enterprise E3 Subscription & Try out all the features

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!!!

Check out Best Alternative to InfoPath -> Try Now

FREE SHAREPOINT 2019 PDF

(Installation & Features)