Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I had a huge farm environment in SPS 2003 recently i migrated my older environment 2003 that was externally hard coded by the designers(Template was different as compare to default template in SPS 2003)in to MOSS using gradual upgarade method(Using stsadm command). Everything goes fine but in document libraries of many site collection along with the root site, Version checking is disable , and its very difficult for me to check each and every site collection and document library and enable the version checking option after going to the settings of document library .

Is there any way or method where i can directly run a script and automatically get enabled in every document library in my SharePoint farm.

Kindly suggest.

share|improve this question
add comment

1 Answer

That is a job for a powershell script (Yes, you can use Powershell in 2007, you just have to do it without the Get-SP... cmdlets). Get a handle to the site collection, then iterate through all of the lists in all of the webs and set the various versioning properties to what you are expecting (there are three or four properties related to versioning). Be sure to call .Update() for each list when you enable the versioning.

However, SharePoint has a lot of hidden lists that you probably don't want to mess with so you might also want to make sure that the List you are looking at is not .Hidden and that it is not in _catalogs.

Here is the rough shell of the powershell script you would probably need :

[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

$site = [Microsoft.SharePoint.SPSite]("http://UrlToSiteCollectionRoot/")

$site.AllWebs | % {
    $_.Lists | % {
        # make sure it is not .Hidden and in _catalogs
        # set the versioning properties you want
        $_.Update()
    }
}

$site.Dispose()
share|improve this answer
    
Is there any way to do it from central admin or MOSS UI ?? –  dharmesh Sep 27 '12 at 10:45
    
No. The UI will let you set versioning but you must do it on each list manually and there is nothing for this in Central Administration. –  Dave Wise Sep 27 '12 at 14:52
    
But manually we are able to see the version option but when we go to the particular document we still unable to see the version option i think this is happening because of the template issue ? –  dharmesh Sep 28 '12 at 14:25
    
Version History for an item is available in the dropdown that appears when you hover over the title of a document in a list in SharePoint. It also is on the ribbon of the properties page when you select 'View Properties' –  Dave Wise Sep 28 '12 at 14:30
    
In view properties i can see versioning option but after hovering the document in the drop down menu its showing every thing except version option.. –  dharmesh Oct 1 '12 at 11:22
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.