Respondido Get Document Library Version History using PowerShell

  • terça-feira, 1 de maio de 2012 12:35
     
     

    Hello,

    I'm trying to generate a report that iterates through a Site Collection's Document Library and reports back all the version history for each document library perferabally any document that has 10+ versionings.

    Can this be done via PowerShell?  I've googled and only found ways to do this with the Object Model.  I perfer PowerShell if possible.

    Thanks for any help.

    v/r


    v/r JShidell

Todas as Respostas

  • terça-feira, 1 de maio de 2012 16:32
     
     Respondido Contém Código

    Hello,

    I found a way to do this via powershell, still need to work on grabbing all the lists items that have 10 or more versions but this is the basic script for those that might be interested in grabbing all document libraries that have versioning enabled and lists the number of versions.

    $site = Get-SPSite http://portal/site
    $webs = $site.AllWebs
    foreach ($web in $webs)
    {
    foreach ($list in $web.Lists)
    {
    if($list.EnableVersioning)
    {
    $item=$list.Items[0]
    foreach($version in $item.Versions)
    {
    Write-Host "Documen Library:" $list.Title "-" "Document:" $item.Title $version.VersionLabel
    }
    }
    }
    }
    $web.Dispose()
    $site.Dispose()


    v/r JShidell