Add X years to date column based on item created date in SharePoint PowerShell

Advertisement
 We are having a requirement to update +3Years  date value based on item created date for all the existing items in the SharePoint list without modifying the  created by and modified by values, we can achieve this using PowerShell.
How to add fields to list in sharepoint using powershell - See more at: http://www.dotnetsharepoint.com/2015/07/how-to-add-fields-to-list-in-sharepoint.html#sthash.ctSnqWrY.dpuf
 
 How to add fields to list in sharepoint using powershell 
Copy value from one filed to another field using PowerShell - See more at: http://www.dotnetsharepoint.com/2015/07/copy-value-from-one-filed-to-another.html#sthash.QPHZ7Tjz.dpuf
Copy value from one filed to another field using PowerShell 
Date formula in SharePoint calculated value
 Date formula in SharePoint calculated value
Date formula in SharePoint calculated value
Date formula in SharePoint calculated value
Date formula in SharePoint calculated value
Date formula in SharePoint calculated value
Date formula in SharePoint calculated value
Copy value from one filed to another field using PowerShell - See more at: http://www.dotnetsharepoint.com/2015/07/copy-value-from-one-filed-to-another.html#sthash.QPHZ7Tjz.dpuf
Copy value from one filed to another field using PowerShell - See more at: http://www.dotnetsharepoint.com/2015/07/copy-value-from-one-filed-to-another.html#sthash.QPHZ7Tjz.dpuf
Copy value from one filed to another field using PowerShell - See more at: http://www.dotnetsharepoint.com/2015/07/copy-value-from-one-filed-to-another.html#sthash.QPHZ7Tjz.dpuf
Copy value from one filed to another field using PowerShell - See more at: http://www.dotnetsharepoint.com/2015/07/copy-value-from-one-filed-to-another.html#sthash.QPHZ7Tjz.dpuf
Copy value from one filed to another field using PowerShell - See more at: http://www.dotnetsharepoint.com/2015/07/copy-value-from-one-filed-to-another.html#sthash.QPHZ7Tjz.dpuf
How to add fields to list in sharepoint using powershell - See more at: http://www.dotnetsharepoint.com/2015/07/how-to-add-fields-to-list-in-sharepoint.html#sthash.ctSnqWrY.dpuf

Copy value from one filed to another field using PowerShell - See more at: http://www.dotnetsharepoint.com/2015/07/copy-value-from-one-filed-to-another.html#sthash.QPHZ7Tjz.dpuf
How to add fields to list in sharepoint using powershell - See more at: http://www.dotnetsharepoint.com/2015/07/how-to-add-fields-to-list-in-sharepoint.html#sthash.ctSnqWrY.dpuf
How to add fields to list in sharepoint using powershell - See more at: http://www.dotnetsharepoint.com/2015/07/how-to-add-fields-to-list-in-sharepoint.html#sthash.ctSnqWrY.dpuf
How to add fields to list in sharepoint using powershell - See more at: http://www.dotnetsharepoint.com/2015/07/how-to-add-fields-to-list-in-sharepoint.html#sthash.ctSnqWrY.dpuf
$Web = Get-SPWeb -Identity http://dotnetsharepoint.com/sites/sharepoint/addyears

$List=$Web.Lists["YourListName"] 

 $items = $list.items

  #Go through all items

foreach($item in $items)

{

    $item["Your Column Name"] = $item["Created"].AddYears(3)

     $modifiedBy = $item["Editor"]

$modifieddate = $item["Modified"]

$item["Editor"] = $modifiedBy

$item["Modified"] = $modifieddate

$item.Update()

  }

  $list.Update()
 
SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM
Advertisements
SHARE

Lakshmi Tulasi Jasti

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

0 comments:

Post a comment