Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How to set the default content type using powershell
WhatsApp
Vijai Anand Ramalingam
13y
28.1
k
0
0
25
Blog
$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
Up Next
Get Content Type Usage Details In SharePoint Using Powershell
Ebook Download
View all
SharePoint Online And Office 365 Administration
Read by 3.6k people
Download Now!
Learn
View all
Membership not found