Get all Sites and sub sites under web application using PowerShell in SharePoint 2013

Get all Sites and sub sites under web application using PowerShell in SharePoint 2013

In this post, we will discuss how to get all the sites and subsites under a web application using PowerShell in SharePoint 2013. Here we will pass the web application URL and it will give all the sites and subsites under it as well as the site URL, Title, and Created date.

Also, read:
Enable and Disable SharePoint 2013 publishing feature using PowerShell

JavaScript Client Object Model JSOM in SharePoint 2013

SharePoint 2016 new features

Below is the PowerShell command:

Add-PSSnapin “Microsoft.SharePoint.PowerShell”

Get-SPSite -WebApplication http://win-pfcp2dgt8di/ -Limit All |

Select -ExpandProperty AllWebs | ft url, Title, Created -auto

The results will appear like below:

Get all Sites and sub sites under web application using PowerShell in SharePoint 2013
Get all Sites and subsites under web application using PowerShell in SharePoint 2013

If you want to export the results into CSV then you can write like below:

Add-PSSnapin “Microsoft.SharePoint.PowerShell”

Get-SPSite -WebApplication http://win-pfcp2dgt8di/ -Limit All |


Select -ExpandProperty AllWebs | ft url, Title, Created -auto > E:\AllSites.csv

Hope this will be helpful.


You May Also like the Following SharePoint Online Tutorials:

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →