Modify the item Created by information in SharePoint 2013

Source: Internet
Author: User

Because the company's system is a bit small bug. Well, to do something bad, the system did not remember the things secretly fill up, but the item created by into me (this How to do, can not let others know I did bad things, must be next door Xiao Li dry!

Too lazy to open Visual Studio to write code. Secretly write a section PowerShell script change it, study it, get it done!

$snapin = Get-pssnapin | Where-object {$_. Name-eq ' Microsoft.SharePoint.Powershell '}
if ($snapin-eq $null)
{
Write-host "Loading SharePoint Powershell Snapin ..."
Add-pssnapin "Microsoft.SharePoint.Powershell"
Write-host "SharePoint Powershell Snapin Loaded"
}

# Get Site and Web
$site = New-object Microsoft.SharePoint.SPSite ("Http://yoursite")
$web = $site. RootWeb

# Get List
$list = $web. lists["ListName"]

$item = $list. GetItemByID (XXX)

Write-host-f Yellow $item ["Author"]
Write-host-f Yellow $item ["editor"]
Write-host-f Yellow $item ["Created"]
Write-host-f Yellow $item ["Modified"]

$item ["Author"] = "123;# Xiao Li"
$item ["editor"] = "123;# Xiao Li"
$item ["Created"] = "3/31/2015 10:35:15 AM"
$item ["Modified"] = "3/31/2015 10:35:15 AM"
$item. Update ()

#问题就是上面这段123; # Xiao Li, with ad or direct name are not, will report readonly field error, id+ name just right, wow haha haha, xiao Li is you!

$web. Update ()
$web. Dispose ()

Modify the item Created by information in SharePoint 2013

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.