Sunday, October 19, 2014

Update Items Using power shell


1.Power shell build upon .net framework So we can access SharePoint objects like Server object model
   in  SharePoint.
2.we can also access files from hard disk using  power shell

Using bellow code we can update the list record 

$w = Get-SPWeb "http://SP2010/sites/Mysite/"
$l = $w.GetList("http://SP2010/sites/Mysite/Lists/Employee"); 
$i = $l.Items[1];
$i["Created"] = "1/6/2012 00:00:00";
$i.Update();
$i["Created"].ToString();

No comments:

Post a Comment