Steps Involved:

  1. Open SharePoint 2010 Management Shell by going to Start | All Programs | SharePoint | Microsoft SharePoint 2010 Products | SharePoint 2010 Management Shell (Run as Administrator).
  2. Run the following script.

Powershell Script:

PowerShell
 
## Get the titles and URLs of all sites directly beneath the current site. 
$uri="http://serverName:10736/sites/ECT/_vti_bin/Webs.asmx?wsdl" 
## Web Service Reference - http://Site/_vti_bin/Webs.asmx
$websWebServiceReference = New-WebServiceProxy -Uri $uri -UseDefaultCredential
Write-Host -ForegroundColor Magenta "Getting all the sites title and URL................"
[System.Xml.XmlNode]$xmlNode=$websWebServiceReference.GetWebCollection() 
foreach($node in $xmlNode.Web)
{
    $node 
}


Output:

Untitled.jpg