PowerShell script to list all Webs and Site Templates in use within a Site Collection


And one more quick post today, this PowerShell script will iterate through all Webs within a Site Collection, print out their Title, URL, and WebTemplate (Site Template) name.

   1: $site = Get-SPSite "http://yoursite"

   2: foreach ($web in $site.AllWebs) { 

   3:     $web | Select-Object -Property Title,Url,WebTemplate 

   4: }

   5: $site.Dispose()

And again, before you use this – please read this: http://gvaro.wordpress.com/2011/03/26/test-out-your-powershell-scripts-first-in-a-non-production-environment-first/ (and also read the comment by Anders Rask)

About these ads

About Geoff Varosky
Geoff Varosky is the Director of Development and Evangelism for Jornata (www.jornata.com), a Microsoft Gold Partner focusing on SharePoint solutions based out of Boston, MA. He has been architecting and developing web based applications for over 13 years, and has been working with SharePoint for the past 6 years. Geoff is an active member of the SharePoint community, Co-Founder and Co-Organizer of the Boston Area SharePoint Users Group (www.bostonsharepointug.org), co-organizer for SharePoint Saturday Boston (www.sharepointsaturday.org/boston) and speaks regularly at SharePoint events and user groups.

2 Responses to PowerShell script to list all Webs and Site Templates in use within a Site Collection

  1. Pingback: Blog del CIIN

  2. Pingback: PowerShell To Update All Sub-Site's Master Page To Parent Master Page in SharePoint 2010 | SharePoint Brian

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 61 other followers

%d bloggers like this: