Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Get a complete report of all site collections

$
0
0

Hi all,

I used below script to get a summary of a site collection.But there is around 200 site collections in the web application.So i need to run these script for 200 times for all site collections.Is there any way to pass web application in the same script to iterate all site collections and get the summary of all site collections.Please help.

function Get-DocInventory([string]$siteUrl) {
$site = New-Object Microsoft.SharePoint.SPSite $siteUrl
foreach ($web in $site.AllWebs) {
foreach ($list in $web.Lists) {
if ($list.BaseType -ne “DocumentLibrary”) {
continue
}

foreach ($item in $list.Items) {
$data = @{
"Site" = $site.Url
"Web" = $web.Url
"list" = $list.Title
"Item URL" = $item.Url
"Item Title" = $item.Title
"Item Created" = $item["Created"]
"Item Modified" = $item["Modified"]
"Created By" = $item["Author"]
"Modified By" = $item["Editor"]

}
New-Object PSObject -Property $data
}
}
$web.Dispose();
}
$site.Dispose()
}


Get-DocInventory "http://tets.testabc.org/sites/abcd" | Export-Csv -NoTypeInformation -Path "C:\Users\Desktop\sitecollectionreport.csv"

please help. Thanks in advance.

Regards,

Praveen


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>