locked
Script to extract checked out files RRS feed

  • Question

  • Guys,

    Please guide me to articles that helps me in extracting the list of checked out files in SharePoint 2007. I have seen below article, but not sure whether it is supported in SP2007 environment:

    http://sharepointpals.com/post/How-to-Get-a-List-of-Checked-out-Files-SharePoint-PowerShell

    Thanks, Anjan

    Friday, October 13, 2017 1:57 PM

All replies

  • [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

    https://sharepoint.stackexchange.com/questions/169831/sp2007-list-all-checked-out-unversioned-files

    Regards

    Prasad Tandel

    Saturday, October 14, 2017 6:09 PM