I have a SPO list where the threshold has exceeded the threshold of 5000. I need to remove 6761785 items and counting.
I have tried to use the following PNP but not having much joy
$items=Get-PnPListItem -List e517d0da-3c1c-47cd-946d-9d295c52f1cd -PageSize 1000
foreach ($item in $items)
{
Write-Host "Getting Items for ListItemID=$($item.Id)" -ForegroundColor Green
try
{
Remove-PnPListItem -List “e517d0da-3c1c-47cd-946d-9d295c52f1cd” -Identity $item.Id -Force
Write-Host "Removing ListItemID=$($item.Id)" -ForegroundColor Red
}
catch
{
Write-Host “error”
}
}
#---------------------------------------------------------------------------------------------------------#
- Any advise welcome.
Thank you