PowerShell 获取Site Collection下被签出的文件

由于权限的设置,当文件被签出时导致别人不可见了,这对校验文件个数的人来说着实是件烦恼的事。幸好利用PowerShell,可以获取Site Collection下被签出的文件。

Resolution

Add-PSSnapin Microsoft.SharePoint.PowerShell

function GetAllCheckOutFiles([string]$siteUrl){
    
    $spSite=Get-SPSite $siteUrl
    
    $spSite.AllWebs|%{
        $_.Lists|where{$_.BaseTemplate -eq "DocumentLibrary" -and $_.Hidden -eq $false}|%{
            
            #Write-Host $_.ParentWeb.Url#
            $_.CheckedOutFiles  |Select-Object {$_.Url,$_.CheckedOutByName}|Out-File c:	xtResult.txt -Append
            
        };

    }

    $spSite.Dispose();
}

GetAllCheckOutFiles("http://reus");
原文地址:https://www.cnblogs.com/OceanEyes/p/powershell-get-all-check-out-files.html