Sharepoint Audit Report

 

Get Items not modified for more then 3 years in entire Farm

 

Get-SPSite -Limit All | Select -ExpandProperty AllWebs | Select -ExpandProperty Lists | Where { $_.GetType().Name -eq “SPDocumentLibrary” -and -not $_.Hidden } |
Select -ExpandProperty Items |
Where { $_[“Modified”] -lt (Get-Date).AddYears(-3) } |
Select Name, {$_[“Modified”]},
@{Name=”URL”;Expression={$_.ParentList.ParentWeb.Url + “/” + $_.Url}}

 

 

Get Items where size is grreater then 5MB

Get-SPSite -Limit All | Select -ExpandProperty AllWebs | Select -ExpandProperty Lists | Where { $_.GetType().Name -eq “SPDocumentLibrary” -and -not $_.Hidden } |
Select -ExpandProperty Items | Where { $_.File.Length -gt 5MB } | Select Name, {$_.File.Length/1MB}, @{Name=”URL”;Expression={$_.ParentList.ParentWeb.Url + “/” + $_.Url}}

Advertisements