Export a list with all the sites in a site collection part 2
This is a follow-up on Part 1 by Mattias Karlssons
As Mattias mentioned, generating a list with Site information is a feature that many people ask for. It’s possible to get the information from the Site Hierarchy or the Site Content and Structure, as Mattias shows in his post I’m going to show you how to retrieve the information through PowerShell and also provide a script that loops through each site and automates this. First off, PowerShell can retrieve a great amount of information about Sites. If you run a simple command such as:
PS > $SPSite = New-Object Microsoft.SharePoint.SPSite("http://yoursite"); $SPSite.AllWebs; $SPSite.Dispose()
You will get tons of information from every Site in your collection. The scipt that I’ve made for this post gathers the following information from each site:
- Name
- Title
- Description
- Theme
- WebTemplate
- Author
- Created
- Modified
- Sites
- Users
- ParentWeb
- Url
- ServerRelativeUrl
- ID
PS > ./Get-SiteInformation.ps1 -Url http://wss PS > ./Get-SiteInformation.ps1 -Url http://wss -ToCsv PS > ./Get-SiteInformation.ps1 -helpDownload the Script Here
[?]

