Content Approval: How to Approve All List Items in Bulk using PowerShell?

When content approval is turned-ON, approving items one by one could be hectic. To bulk approve items, We can utilize PowerShell, and here is my PowerShell script to bulk approve items pending content approval.

This was a huge time saver for me during a migration project.

PowerShell script to approve List items in Bulk:

This blog post will show you how to use PowerShell to approve all list items in bulk. This can be a useful tool if you need to quickly approve a large number of items without having to click the approve button for each item manually.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Site URL and List Name variables
$WebURL="https://portal.crescent.com/sites/ops/"
$ListName="Tasks"

#Get all List Items
$ListItems= (Get-SPWeb $WebURL).Lists[$ListName].Items

#Iterate through each item
foreach($Item in $ListItems)
{
    #Approve Item
    $item["_ModerationStatus"] = "0" #1 to reject
  
    #Update the item
    $item.Update()
}
write-host "Total Items Approved:"$ListItems.Count

This PowerShell script simply loops through all items in the given list and approves them by setting the Approval Status field (Internal name is “_ModerationStatus”).

approve items using powershell

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

One thought on “Content Approval: How to Approve All List Items in Bulk using PowerShell?

  • wonderful, thanks so much for this!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *