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. $SiteURL = "http://webapplication.domain.com/managedpath/sitecollection
  4. $Site = Get-SPSite $SiteURL
  5. foreach($Web in $Site.AllWebs)
  6. {
  7. $ListsToUpdate = @()
  8. foreach($list in $web.lists)
  9. {
  10. $ListsToUpdate += $list.Title
  11. }
  12. foreach($listToUpdate in $ListsToUpdate)
  13. {
  14. $List = $Web.Lists[$listToUpdate]
  15. #Set the Draft Version Visibility. 0 = Reader, 1 = Author, 2 = Approver
  16. $List.DraftVersionVisibility = 0
  17. $List.Update()
  18. }
  19. $Web.Dispose()
  20. }

Thank you for reading.