Home > Sharepoint > Export a list with all the sites in a site collection part 2

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

I’ve also added a switch -ToCsv, that lets you write the information to a Csv file instead of writing it to the PS Host.

Running The Script:


PS > ./Get-SiteInformation.ps1 -Url http://wss

PS > ./Get-SiteInformation.ps1 -Url http://wss -ToCsv

PS > ./Get-SiteInformation.ps1 -help

Download the Script Here

Rating 3.00 out of 5
[?]
Categories: Sharepoint Tags:
  1. No comments yet.
  1. No trackbacks yet.

Spam Protection by WP-SpamFree