3

I am in the process of migrating our SP2007 farm to SP2013 using a migration tool.

Where it is currently having issues, is where it skips documents that have "no checked in version".

I can see these documents if I go into each library, and then "Manage checked out files".

Is there a way through STADM or PowerShell that I can run a report across the farm to see all of these files?

I plan to e-mail the user and tell them to check it in, or lose it forever. Thanks in advance.

1

You can try the below "Get All Checked Out Documents with no Checked In Version"

[System.Reflection.Assembly]::Load(“Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”)

function CheckedOutItems()
{
    $url=Read-Host “Please Enter In Site Url”
    “SiteURL ‘t” + “FileName ‘t” + “CheckedOutTo ‘t” + “ModifiedDate ‘t” + “Version” >> c:\temp\checkedoutfiles.csv
    $site = New-Object Microsoft.SharePoint.SPSite($url)
    $webs = $site.AllWebs

    foreach($web in $webs)
    {
        $listCollections=$web.Lists
        foreach($list in $listCollections)
        {
            if($list.BaseType.ToString() -eq “DocumentLibrary”)
            {
                $dList=[Microsoft.SharePoint.SPDocumentLibrary]$list
                $items = $dList.Items
                $files = $dList.CheckedOutFiles
                foreach($file in $files
                {
                    $wuse=$file.DirName.Substring($web.ServerRelativeUrl.Length)
                    $web.Url + “‘t” + $wuse + “‘/” + $file.LeafName + “‘t” + $file.CheckedOutBy.Name + “‘t” + $file.TimeLastModified.ToString() + “‘t” + “No Checked In Version” >> c:\temp\checkedoutfiles.csv
                }
            }
        }
    $web.Dispose()
    }
$site.Dispose()
}

CheckedOutItems
  • Super, thanks. Just one notice - you need to update the line foreach($file in $files to be foreach($file in $files) as it's missing the last ) from the author. – Rob Sked Feb 12 '16 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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