How to delete SharePoint list items before specific date in SharePoint online using Powershell?
Hello SharePointers, Below are the Pnp Powershell script to delete SharePoint list items before specific date in SharePoint online using Powershell. Connect-PnPOnline -Url <yourtenant>.sharepoint.com $listName = “EMployee” $items = Get-PnPListItem -List $listName -Fields “Title”,”Created”,”ID”,”GUID” // 30 days is the cut off period $days = (Get-Date).AddDays(-30) foreach($item in $items) { $created = $item[“Created”] Write-Host “Item created […]