Report SharePoint Content Source Last Crawl Duration

Here’s a simple Windows PowerShell script example to list out the search service content sources and the last crawl duration times. $results = @() function Get-FormatedTimeSpan() { param([TimeSpan]$TimeSpan) if($TimeSpan -and $TimeSpan -eq [TimeSpan]::MinValue -or $TimeSpan -eq [TimeSpan]::MaxValue) { $TimeSpan = [TimeSpan]::Zero } return [string]::Format( “{0:D2}:{1:D2}:{2:D2}”, $TimeSpan.Days * 24 + $TimeSpan.Hours, $TimeSpan.Minutes, $TimeSpan.Seconds); } # enumerate…


Export Test-SPContentDatabase Results to a CSV File

If you want to collect the results from Test-SPContentDatabase into a CSV file, you can do some with some additional PowerShell code.  The following will create a timestamped CSV file containing the output from Test-SPContentDatabase. # array to store the output $results = @() # enumerate all the databases in the farm Get-SPContentDatabase | %…


Set PowerShell ISE as the Default Program for Opening PowerShell Scripts

If you want to set PowerShell ISE as the default application for opening PowerShell script files (.ps1), you simple need to change the file type associations on the local machine. Open Control Panel > Programs > Default Programs > Associate a file type or protocol with a program. Navigate to the .ps1 file extension and…

1