我想要查看 Sharepoint 2010 中所有文档库中的所有文档的列表。我想要这样做的原因是我需要查看过去 X 天内更改过的文档。
这可能吗?
答案1
获取 SPReport.ps1:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ea 0
$X=10
$TimeFilter = (Get-Date).AddDays(-$X)
$SharepointUrl = http://www.sharepoint.com
"Name, Time, Size KB" | Out-file XDocList.csv
$SPWeb = Get-SPWebApplication $SharepointUrl | Get-SPSite -Limit All | Get-SPWeb -Limit All
% ($SPitem in $ SPWeb){% ($list in $ SPitem.Lists)
{
If ($list.BaseType -eq "DocumentLibrary")
{% ($item in $list.Items)
{ If ($item.URL.StartsWith("_")) {Break}
If ($item.URL.EndsWith(".aspx")) {Break}
If ($item.File.TimeCreated -ge $TimeFilter)
{
$result = """$($SPitem.URL)/$($item.URL)"", $($item.File.TimeCreated), $( $item.File.Length/1KB)"
$result | Out-File XDocList.csv -Append
}
}
}
} }