首页 > 其他 > 详细

[存储记录]SharePoint循环删除任务

时间:2017-06-30 14:52:46      阅读:247      评论:0      收藏:0      [点我收藏+]

$spWeb =get-spweb http://.....
$spList =$spWeb.GetListFromUrl("http://..../Lists/Tasks/AllItems.aspx")
$spQuery = New-Object Microsoft.SharePoint.SPQuery
$camlQuery = ‘<Where><Leq><FieldRef Name="Created" /><Value Type="DateTime">2017-04-18</Value></Leq></Where>‘
$spQuery.Query = $camlQuery
$spListItem = $spList.GetItems($spQuery)
$spListItem[0].ID
$spListItem[0].UniqueId
$spListItem[0].Title
Write-Host $spListItem.Count
$spListItem|%{$spList.GetItemById($_.Id).Delete()}
$spList.Update()

[存储记录]SharePoint循环删除任务

原文:http://www.cnblogs.com/wangbaohui/p/7098515.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!