Quantcast
Channel: SharePoint 2010 - General Discussions and Questions forum
Viewing all articles
Browse latest Browse all 17574

Powershell to get- every subsite in farm

$
0
0

(Powershell noob here)  I'm attempting to write a script to delete every /SitePages/Results.aspx file in the farm, but only for SubSites.  So far i've got this, which gives me each site in the farm, but i only want to do this on subsites.

$sites= Get-SPSite -WebApplication $url|Where-Object{$_.Url -like"$url/sites/*"}
foreach($site in $sites){
# Delete fuctions here.
}
I'd really like to build this script on my own but i wont argue with anyone that just happens to have this already built.  :) 

Viewing all articles
Browse latest Browse all 17574

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>