Can we disable the versioning changes on the libraries and only force it from the Organization

john john Pter 505 Reputation points
2025-02-19T19:35:28.6333333+00:00

Hi All,

I am reading about the new capabilities offered by SharePoint for "Version history" @ https://learn.microsoft.com/en-us/sharepoint/version-overview .

now I have this question:-

Is there a way to disable those versioning settings from the library level for all libraries and all sites (current and new) ,

User's image

and only allow this to be managed from the Organization level?

User's image

or this is not supported?

Thanks

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,322 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Hunsberger 76 Reputation points
    2025-02-19T20:12:34.3333333+00:00

    This link describes how it works: https://learn.microsoft.com/en-us/sharepoint/set-default-org-version-limits

    The general idea seems to be to set the organizational limits from the SharePoint Admin Center, which are the defaults. But then you can configure version history limits on individual sites, as needed.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Emily Du-MSFT 50,411 Reputation points Microsoft Vendor
    2025-02-20T08:02:54.4166667+00:00

    For current site, you could disable versioning settings for all document libraries in a site collection by using following PowerShell.

    Note: Replace site URL with your site.

    #Function to Disable Versioning on All Document Libraries in a SharePoint Online Site
    Function Disable-SPOVersionHistory()
    {
        param
        (
            [Parameter(Mandatory=$true)] [string] $SiteURL
        )
        Try {
            Write-host -f Yellow "Processing site:"$SiteURL
     
            #Setup the context
            $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
            $Ctx.Credentials = $Global:Credentials
       
            #Get the site, subsites and lists from given site
            $Web = $Ctx.web
            $Ctx.Load($Web)
            $Ctx.Load($Web.Lists)
            $Ctx.Load($web.Webs)
            $Ctx.executeQuery()
     
            #Array to exclude system libraries
            $SystemLibraries = @("Form Templates", "Pages", "Preservation Hold Library","Site Assets", "Site Pages", "Images",
                                "Site Collection Documents", "Site Collection Images","Style Library")
             
            #Get All document libraries
            $DocLibraries = $Web.Lists | Where {$_.BaseType -eq "DocumentLibrary" -and $_.Hidden -eq $False -and $_.Title -notin $SystemLibraries}
            ForEach($Library in $DocLibraries)
            {
                #disable versioning in each document library
                $Library.EnableVersioning = $False
                $Library.Update()
                $Ctx.ExecuteQuery()
                Write-host -f Green "`tVersioning has been turned OFF at '$($Library.Title)'"
            }
      
            #Iterate through each subsite
            ForEach ($Subweb in $Web.Webs)
            {
                #Call the function recursively
                Disable-SPOVersionHistory($Subweb.url)
            }
        }
        Catch {
            write-host -f Red "Error:" $_.Exception.Message
        }
    }
     
    #Set Parameters
    $SiteURL="https://tenant.sharepoint.com/sites/marketing"
     
    #Get Credentials to connect
    $Cred= Get-Credential
    $Global:Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)
     
    #Call the function to disable versions on all document libraries
    Disable-SPOVersionHistory -SiteURL $SiteURL
    

    For new site, you need to set version history limit in the tenant level.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.