Version history control for OneDrive for Business

Anonymous
2019-05-11T17:13:42+00:00

Hello there,

i would like to set the onedrive settings down from 500 versions (Default) to 20, because of Backup purposes.

how do i configure that in bulk (2000 users) are using ondrive as of now.

Microsoft 365 and Office | OneDrive | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. Anonymous
    2019-05-11T21:13:40+00:00

    Hi Azanzane,

    You may bulk change the versioning settings by PowerShell. First, you may close the default minimum version number setting by the following command:

    Set-SPOTenant -EnableMinimumVersionRequirement $false

    Then you may refer to the PowerShell codes in the following site:

    Limit Versioning and Delete Old Versions in SharePoint

    Disclaimer: Microsoft provides no assurances and/or warranties, implied or otherwise, and is not responsible for the information you receive from the third-party linked sites or any support related to technology.​​

    $SPsiteCollection = Get-SPSite "http://SharePointSite.com"

    Loop through all Webs in the Site Collection

    foreach($SPweb in $SPsiteCollection.AllWebs)

    {

    #loop through all lists in web

    foreach ($SPlist in $SPweb.Lists)

    {

    if($SPlist.EnableVersioning -eq $true)

    {

    write-host "Setting versioning Limit for :" $SPlist.title

    $SPlist.MajorVersionLimit = 20;

    To Disable Versioning use: $SPlist.EnableVersioning=$false

    To Enable Minorversion: $SPlist.EnableMinorVersions = $true;

    Minor version Limit: $SPlist.MajorWithMinorVersionsLimit = 20;

    $SPlist.Update();

    }

    }

    }

    Please let us know if you have any further concerns.

    Best Regards,

    Nathan

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2019-05-11T21:23:59+00:00

    Thank you Nathan, i will try this and confirm.

    0 comments No comments
  3. Anonymous
    2019-05-11T22:43:51+00:00

    Hi Azanzane,

    Please feel free to post back if there is any update or if you have any question in the process of changing the versioning limit. 

    Best Regards,

    Nathan

    0 comments No comments
  4. Anonymous
    2019-05-15T22:55:24+00:00

    Hi Azanzane,

    May I know if you have tried my suggestion to change versioning limit from your OneDrive for Business sites? Please come bake and share with us if there is any updates.

    Best Regards,

    Nathan

    0 comments No comments
  5. Anonymous
    2019-05-16T00:13:08+00:00

    Hello Nathan,

    No i haven't gotten to it yet. we will be doing that by next week and i will keep you posted for sure

    regards,

    0 comments No comments