문제

With following code I have recycled list items and have stored item GUID in $DeletedItem:

for($i=$ListItems.Count-1; $i -ge 0; $i--)
{
     write-host "Deleted List Item with ID:$($ListItems[$i].ID)"
     $DeletedItem= $ListItems[$i].recycle()
}

I want to recover the items by using saved item's GUIDs, Is that possible? How I recover list items using powershell?

도움이 되었습니까?

해결책

Here you go:

Assuming $DeletedItem = $ListItem.recycle():

$site = Get-SPSite http://server/sites/site
$site.RecycleBin.Restore($DeletedItem)

Put it into a foreach cycle and you'll be able to restore a collection of items: Assuming $DeletedItems is a collection of GUIDs:

ForEach ($deletedGuid in $DeletedItems)
{
    $site.RecycleBin.Restore($deletedGuid)
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top