I want to delete a specific list item from a list. if i go in UI and try to delete it, it throws access denied error. Even if try to delete using below powershell it says the same thing. if i try to view the version history of the item, it doesnt show anything.if i try to see item permission, it throws some error. How do i get rid of it?. I am site collection administrator. please help.
if(-not(
Get-PSSnapin | Where { $_.Name -eq "Microsoft.SharePoint.PowerShell"})
) {
Add-PSSnapin Microsoft.SharePoint.PowerShell;
}
$web = get-spweb http://xyz/
$list = $web.lists | where {$_.title -eq “Employee”}
#Write-host “List $($list.title) has $($list.items.count) entries”
$list.getitembyid(4256).Delete()

0 commentaires:
Enregistrer un commentaire