Is it possible to list the Default Content type per Library via PowerShell?

  • do you want to get default content type in all lists in a give site? – Waqas Sarwar MVP May 5 '15 at 20:37

You can get the list of content types associated with a List. And the first one is the default one.

$webs = Get-SPSite http://siteurl | Get-SPWeb 

foreach ($web in $webs) 
    foreach ($list in $web.lists) 
        if($list.ContentTypes.Count > 0)
            Write-Host "Default Content Type = " + $list.ContentTypes[0].Name
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.