Solution: Crawl history can be viewed from SharePoint 2013 search service application as in the below screen. It gives the crawl log history report for all content sources.
Why don't we automate it with PowerShell, so that we'll get crawl history report in E-mail?
PowerShell to get crawl log history in E-mail:
This PowerShell script extracts crawl history data and sends out Email.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue #Get the search service application $SSA = Get -SPEnterpriseSearchServiceApplication #-Identity "Search Service Application Name" #Get all content sources $ContentSources = Get -SPEnterpriseSearchCrawlContentSource -SearchApplication $SSA #| where {$_.Name -eq $ContentSourceName} $ReportDate = Get-Date -format "dd-MM-yyyy" #CSS Styles for the Table $style = "Crawl History Report: " $style = $style + "<style>BODY{font-family: Arial; font-size: 10pt;}" $style = $style + "TABLE{border: 1px solid black; }" $style = $style + "TH{border: 1px solid black; background: #dddddd; padding: 5px; }" $style = $style + "TD{border: 1px solid black; padding: 2px; }" $style = $style + "</style>" #Frame Email body $EmailBody = $ContentSources | Select Name, SuccessCount, WarningCount, ErrorCount,CrawlStarted,CrawlCompleted, @{label= "CrawlDuration" ;expression={$_.CrawlCompleted - $_.CrawlStarted}} | ConvertTo-Html -Head $style #Set Email configurations #Get outgoing Email Server $EmailServer = (Get -SPWebApplication -IncludeCentralAdministration | Where { $_.IsAdministrationWebApplication } ) | %{$_.outboundmailserviceinstance.server} | Select Address $From = "CrawlReport@crescent.com" $To = "SharePointAdmin@crescent.com" $Subject = "Crawl History Report as on: " + $ReportDate $Body = "Hi SharePoint Team,<br /><br />Here is a Crawl History report as on $ReportDate <br /><br />" + $EmailBody #Send Email Send -MailMessage -smtpserver $EmailServer .Address -from $from -to $to -subject $subject -body $body -BodyAsHtml |
Read more: http://www.sharepointdiary.com/search/label/Admin%20Reports#ixzz4LeY1qnC5
No hay comentarios:
Publicar un comentario