Delete all Pages - Sharepoint Powershell
This post highlights how to remove all sub-sites or pages permanently from a specific SharePoint site collection/web using a PowerShell script. Prerequisite Before using the below script user needs admin-level access . Change the site collection name as per your requirements. NOTE: Use Below Script and kindly pass the valid URLs/List Name to execute the script. Script: Add-PSSnapin Microsoft.SharePoint.PowerShell $site =Get-SPSite - identity < Your URL > $subSiteColl = $site.RootWeb.Webs; $subSites =@ () for ($i = 0 ;$i -le $subSiteColl.Count - 1 ;$i ++ ) { $subSites += $subSiteColl[$i]; } foreach ($subSite in $subSites){ $targetWeb =get-spweb - identity $subSite.URL; $targetListGeneral = $targetWeb.lists[ " <List Name> " ]; ...