Change The List Setting To Give Users With Read Permission The Ability To See Draft Version Of Items

In this article, we will see how to change the list level settings, which allows users having read permission see the items with minor versions, using UI and PowerShell script.

We had a recent request from the customer to do it for all the lists and manually doing it for all the lists is not possible and we are left with PowerShell. Let’s explore both the options to make the change.

Option 1

Change the setting using UI

Please navigate to the list/library and click on list/library settings on top ribbon and change the setting, as highlighted in the screenshot given below.


Option 2

Using PowerShell

PowerShell script given below is just for one list. 

  1. #-------------------------------------------------------------------------------------------------  
  2. $WebURL = Read-Host “Please provide the site URL”  
  3. $Web = Get-SPWeb $webURL  
  4. $List = $Web.lists[“Documents”]  
  5. $List.Draftversionvisibility = 0  
  6. # Note: Reader = 0, Author =1, Approver = 2  
  7. $List.update();  
  8. $web.Dispose();  

 

 

  1. #-----------------------------------------------------------------------------------------------------------------------  
  2. The below PowerShell script includes all the lists in all the subsites within a site collection.  
  3.   
  4. $SiteURL = "http://webapplication.domain.com/managedpath/sitecollection  
  5. $Site = Get-SPSite $SiteURL  
  6. foreach($Web in $Site.AllWebs)  
  7. {  
  8.     $ListsToUpdate = @()  
  9.     foreach($list in $web.lists)  
  10.     {  
  11.         $ListsToUpdate += $list.Title  
  12.     }  
  13.     foreach($listToUpdate in $ListsToUpdate)  
  14.     {  
  15.         $List = $Web.Lists[$listToUpdate]  
  16.         #Set the Draft Version Visibility. 0 = Reader, 1 = Author, 2 = Approver  
  17.         $List.DraftVersionVisibility = 0  
  18.         $List.Update()  
  19.     }  
  20.     $Web.Dispose()  
  21. }   

Thank you for reading.