Reduce one day in SharePoint list Column using PowerShell

Advertisement
In this article we can able to see how to reduce one day less for a particular date column in SharePoint list using PowerShell.


Copy data from one list to another list in SharePoint using PowerShell
We migrated the content from lotus notes to SharePoint, due to some time Zone difference we got one last more for all the items in the list. For that using PowerShell we reduced the one day.
  
Add-PSSnapin microsoft.sharepoint.powershell
$spWeb = Get-SPWeb "http://dotnetsharepoint.com/sites/sharepoint"
write-host $spweb
$List=$spWeb.Lists["ListName"]

write-host $lList
$spItems = $List.GetItems()

foreach($spItem in $spItems)

{

    $datevalue = $spItem["DateColumnName"].AddDays(-1);

$spItem["DateColumnName"] = $datevalue
$modifiedBy = $spItem["Editor"]
$modifieddate = $spItem["Modified"]
$spItem["Editor"] = $modifiedBy
$spItem["Modified"] = $modifieddate
$spItem.Update()
$list.Update()
 }
SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM
Advertisements
SHARE

Unknown

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a comment