Friday, September 26, 2008

List of Content Type using Powershell

Scenario:
Getting list of Content Type for a site.

Solution:
Get the Web object and enumerate the content types

Code:

$site=spweb "http://localhost"
$web=$site.OpenWeb()

$web.lists | select title,contenttypes
Output:

Title
-----
Documents
Images
Master Page Gallery
Pages
Workflow History
Workflow Tasks

Article:
http://blogs.flexnetconsult.co.uk/colinbyrne/2006/12/03/SharePointPowerShell6ApprovingAllPublishingPages.aspx

1 comments:

Anonymous,  March 12, 2012 at 10:10 AM  

this is very useful, thank you.