How to update the modified by using power shell

In this example I want to show how to update the modify by and modified date using PowerShell.
Sometimes it may happen that exiting item or items we need to update with the user name instead of our name, for that we can achieve using power shell easily.

Here I am updating the Last modified name and the date with name for a particular items based on the item ID.

$web = Get-SPWeb
$list = $web.lists["UpdateModified"]
#23 is my item id,i am update for a particular item only
$item = $list.items.getitembyid(23)
$username = $Web.EnsureUser(domain/username)
$item["Editor"] = $username
$item["Modified"] = "7/17/2015 8:00 AM"

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Lakshmi Tulasi Jasti

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


Post a Comment