TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
How to set the default content type using powershell
Vijai Anand Ramalingam
Apr 07, 2011
28
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
In this blog we will be seeing how to set the default content type using powershell
$site=Get-SPSite "
http://serverName:1111/
"
$web=$site.RootWeb
$list=$web.Lists["Shared Documents"]
$currentOrder = $list.ContentTypes
$result=New-Object System.Collections.Generic.List[Microsoft.SharePoint.SPContentType]
foreach ($ct in $currentOrder)
{
if ($ct.Name.Contains("_CustomContentType"))
{
$result.Add($ct)
}
}
$list.RootFolder.UniqueContentTypeOrder = $result
$list.RootFolder.Update()
How to set the default content type using powershell
Next Recommended Reading
Programmatically set the default content type in SharePoint list