How To Get Lists With Content Approval Enabled/Disabled In SharePoint Online Using PnP PowerShell

In this blog, we are going to see the lists and libraries are enabled with Content Approval in SharePoint online using PnP PowerShell.
 
Content Approval for the lists and libraries are enabled from List or Library Settings page.
  • Go to Library Setting for Library / List Settings for List
  • Click on Versioning Settings from the Settings page
  • Select Yes under “Content Approval” section.
  • Then click OK button to enable the content approval for selected list or library.

All lists with Content Approval property

The below PnP PowerShell command used to retrieve and print the content approval property for all lists and libraries from the SharePoint site,
  1. PS:> $cred = Get-Credential  
  2. PS:> Connect-PnPOnline -Url https://<tenant>.sharepoint.com/sites/dev -Credential $cred  
  3. PS:> Get-PnPList | Select-Object Title,EnableModeration  
 
Lists & Libraries with Content Approval enabled

The below PnP PowerShell command used to filter the lists & libraries with Content Approval enabled for the SharePoint Online website.
  1. PS:> $cred = Get-Credential  
  2. PS:> Connect-PnPOnline -Url https://<tenant>.sharepoint.com/sites/dev -Credential $cred  
  3. PS:> Get-PnPList | Select-Object Title,EnableModeration | Where-Object {$_.EnableModeration -Eq $true }  
 
Lists & Libraries with Content Approval disabled

The below PnP PowerShell command used to filter the lists & libraries with Content Approval disabled for the SharePoint Online website.
  1. PS:> $cred = Get-Credential  
  2. PS:> Connect-PnPOnline -Url https://<tenant>.sharepoint.com/sites/dev -Credential $cred  
  3. PS:> Get-PnPList | Select-Object Title,EnableModeration | Where-Object {$_.EnableModeration -Eq $false }  
Ebook Download
View all
Learn
View all