Friday, October 3, 2014

Content Approval on Multiple Lists

Scenario:
One of my colleague wanted to activate the Content Approval on a couple of lists and libraries within a site and we know that going to the settings of 25 libraries for the same setting is easy but a pain.

Solution:
This can be done through Powershell.
Add-PSSnapin "Microsoft.SharePoint.PowerShell"

$siteUrl="http://www.SharePointBlue.com"
$lists = @("Documents","New Documents","ListA")


$site=Get-SPSite $siteUrl
$web=$site.RootWeb

ForEach ($listName in $lists) 
{
    try
    {
        $list=$web.Lists[$listName]
        $list.EnableModeration = $false
        $list.Update()

        $MSG = $Now.ToString() +  " | Content Approval activated on list: " + $listName
        write-host $MSG
    }
    catch [system.exception]
    {
        $Now = [System.DateTime]::Now
        $MSG = $Now.ToString() +  "Exception: " + $_.Exception.Message
        write-host -f red $MSG
    }
}

Publiahing Sites vs Communication Sites

It was announced in SharePoint Virtual Summit in May 2017, a more modern way of content publishing is released called Communication Sites. ...