http://blogs.technet.com/b/victorbutuza/archive/2010/01/15/crawl-taking-indefinitely-to-complete.aspx
This is the power-shell version of the c# code shown on the mentioned site.
if(-not(
Get-PSSnapin | Where { $_.Name -eq "Microsoft.SharePoint.PowerShell"})
) {
Add-PSSnapin Microsoft.SharePoint.PowerShell;
}
clear
foreach ($osite in $spwa.Sites)
{
foreach ($oweb in $osite.AllWebs)
{
write-host $oweb.Url
write-host "========================================================="
foreach ($olist in $oweb.Lists)
{
if ($olist.Hidden -eq $false)
{
try
{
write-host "Title: " $olist.Title;
if ($olist.DefaultView -eq $null)
{
write-host "ERROR: No default list view found
" -ForegroundColor Red
}
else
{
#remove this if you have lots of lists
write-host "DefaultViewURL: " $olist.DefaultViewUrl
write-host "DefaultViewTitle: " $olist.DefaultView.Title
}
}
catch
{
write-host "ERROR"
}
}
}
write-host "========================================================="
$oweb.Dispose();
}
$osite.Dispose();
}
No comments:
Post a Comment