SharePoint has always had confusion between sites and webs. What we are really talking about hear is for a given site (not site collection, but really a web) such as a team site we want to get all the sites below it. An easy way to do this is to use PowerShell if you are using SharePoint 2010.
- Open SharePoint 2010 Management Shell (As Administrator).
- Paste the snippet of code below into the prompt. Note, the first line can be uncommented if you are just using a PowerShell prompt that doesn’t have the SharePoint PowerShell commands added already.
$url = "http://mysharepoint/SiteDirectory/site1"
$site = Get-SPWeb ($url)
foreach ($web in $site.Site.AllWebs)
Write-Host ($web.Name + "|" + $web.Url)
In my example I am writing to the console the name of the site, the pipe character as a delimiter, and then the url.