The below powershell script can be used to analyze sharepoint farm(SP10/SP13/SP16). Below powershell script will fetch the web url, web title ,web template id, last item modified date and site owner details of sharepoint farm. Please change the report path as per your need.
Script will export Web URL, Web Title, Web Template , Web Template Id, Last Item Modified Date and Site Owner details in to CSV format.
******************************PowerShell Script************************************
cls
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
{
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
$Sites= Get-SPSite -Limit All
$Report=@()
Foreach($site in $Sites)
{
Foreach($web in $site.Allwebs)
{
$Report +=Get-SPWeb -Identity $web.url | select url,Title ,@{Name="Template"; Expression={$web.WebTemplate + $web.WebTemplateId}},LastItemModifiedDate,@{Name="Owner";Expression={$site.Owner.UserLogin}}
}
}
$Report | Export-CSV -Path D:\report.csv -NoTypeInformation
Write-Host "Report Execution Completed" -ForegroundColor Green
Script will export Web URL, Web Title, Web Template , Web Template Id, Last Item Modified Date and Site Owner details in to CSV format.
******************************PowerShell Script************************************
cls
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
{
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
$Sites= Get-SPSite -Limit All
$Report=@()
Foreach($site in $Sites)
{
Foreach($web in $site.Allwebs)
{
$Report +=Get-SPWeb -Identity $web.url | select url,Title ,@{Name="Template"; Expression={$web.WebTemplate + $web.WebTemplateId}},LastItemModifiedDate,@{Name="Owner";Expression={$site.Owner.UserLogin}}
}
}
$Report | Export-CSV -Path D:\report.csv -NoTypeInformation
Write-Host "Report Execution Completed" -ForegroundColor Green