Windows Search Server: initiate crawls by command line and scheduled task
article #965, updated 3069 days ago

The automatic crawl scheduler in Windows Search Server sometimes fails; you can get far more positive and creative control with scripting. Here’s how.

First you’ll need the name of the “Search Service Application”. I found these under “Farm Search Administration” in the SharePoint site; the default/built-in is named “Search Service Application”, but on the server being worked there was a second custom one for production work, which for this document we will call “SSAXYZ”.

Now we need the “Content Sources” list. Here’s where we learn whether it’s working or not.

Next step is to create the scripts below. You may want all of them. A usually working location and filename is in each initial comment. If your server doesn’t have an E:, you will need to rewrite just a tad.

The way it works is, you set your scheduled task to run the CMD, and the CMD starts up the PowerShell. It is possible to have the scheduled task run the PowerShell directly, but it’s much harder to read that way. There are two pairs of scripts below, one pair for incremental crawls, and one for full. It is often recommendable to run the incremental daily and the full weekly, if available server horsepower (most of all RAID) is enough for the fileset(s) involved.

The PowerShell comes from here, it stops any crawling which may be going on (or stalled) and restarts the desired (full or incremental), for every Search Service Application. So if you have multiple SSA’s you may want to modify so that it only does what you want.

REM E:\Search Server Scripts\Initiate-Full-Crawl.cmd
C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe  " & ' E:\Search Server Scripts\\Initiate-Full-Crawl.ps1 ' "
# E:\Search Server Scripts\Initiate-Full-Crawl.ps1
Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "SSAXYZ" | ForEach-Object {
    if ($_.CrawlStatus -ne "Idle")
    {
        Write-Host "Stopping currently running crawl for content source $($_.Name)..."
        $_.StopCrawl()
        do { Start-Sleep -Seconds 1 }
        while ($_.CrawlStatus -ne "Idle")
    }
    Write-Host "Starting full crawl for content source $($_.Name)..."
    $_.StartFullCrawl()
}
REM E:\Search Server Scripts\Initiate-Incremental-Crawl.cmd
C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe  " & ' E:\Search Server Scripts\\Initiate-Incremental-Crawl.ps1 ' "
# E:\Search Server Scripts\Initiate-Incremental-Crawl.ps1
Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "SSAXYZ" | ForEach-Object {
    if ($_.CrawlStatus -ne "Idle")
    {
        Write-Host "Stopping currently running crawl for content source $($_.Name)..."
        $_.StopCrawl()        
        do { Start-Sleep -Seconds 1 }
        while ($_.CrawlStatus -ne "Idle")
    }
    Write-Host "Starting full crawl for content source $($_.Name)..."
    $_.StartIncrementalCrawl()
}

Categories:      

==============

'atop' for Linux CPU and other resources and performance checking
article #964, updated 3069 days ago

‘atop’ seems to have some extraordinary depth.

http://linux.die.net/man/1/atop

Categories:      

==============

Fix AutoComplete in Outlook - size maximum!
article #963, updated 3075 days ago

AutoComplete, in Outlook, has a maximum number of contacts by default. This is either 1,000 or 2,000, depending on version, and can be changed by registry entry. One of the symptoms which shows up, is AutoComplete showing email addresses only for some entries, and not names.

The fix is here:

https://support.microsoft.com/en-us/kb/2199226

If you were using Exchange 2013 or later with Outlook 2013 or later, it is thought that AutoComplete may repair itself once the maximum has been sufficiently set. If automatic repair doesn’t occur, you’ll have to manually remove AutoComplete items and recreate.

Categories:      

==============

Set Static IP, DNS, and WINS using the 'netsh' command
article #962, updated 3076 days ago

If you’re working remotely, you don’t want your connection to go down, so we need to do it all in one command. So:

netsh interface ip set address "Local Area Connection" static <PC-IP> <Subnet-Mask> <Default-Gateway> & netsh interface ip set dns name="Local Area Connection" static <Primary-DNS> primary & netsh interface ip add dns "Local Area Connection" <Secondary-DNS> index=2

Be sure not to include the <> characters when replacing!

Categories:      

==============

Replace DNS settings with static using netsh
article #548, updated 3076 days ago

First, set the primary DNS as a static primary, bypassing DHCP for DNS only:

netsh interface ip set dns name="Local Area Connection" static 8.8.8.8 primary

Then, add the secondary DNS:

netsh interface ip add dns name="Local Area Connection" 8.8.4.4 index=2

In the example above, 8.8.8.8 is being set as primary, and 8.8.4.4 as secondary; these are Google’s public DNS servers, quite useful in some circumstances. On many systems the names of the interfaces (above, “Local Area Connection”) will have to be changed, either to “Local Area Connection 2” or something more different for wireless; you can get the names using ‘ipconfig’ (they are prefixed with “Ethernet adapter”, take those two words off and you have it) or GUI.

Categories:      

==============

Control EOL/O365 "Clutter" folders with PowerShell
article #961, updated 3081 days ago

Lots of options available for control in PowerShell, both per-user and across the enterprise:

http://o365info.com/manage-clutter-by-using-powershell-office-365/

Categories:      

==============

Video oddities in Windows 8.1
article #960, updated 3082 days ago

This is Windows 8.1 only, not 7, not 10. It is not known whether 8.0 is affected.

The current known operative case is Citrix-hosted applications, in a dual-monitor situation. If you see a malfunction, go to Control Panel, All Control Panel Items, Display. If “Let me choose one scaling level for all my displays” is unchecked, check it. It will require logoff/logon. And the problem will be fixed.

Categories:      

==============

Print-to-PDF using Ghostscript
article #959, updated 3088 days ago

This page appears a bit outdated, but it should still work:

https://www.stat.tamu.edu/~henrik/GSWriter/GSWriter.html

Categories:      

==============

Excellent document scanning software for Windows
article #958, updated 3092 days ago

This is an excellent tool for any standard Windows scanner. It handles multiple formats, storage and searching, OCR, et al.:

http://www.naps2.com/

Categories:      

==============

Identifying Exchange versions
article #957, updated 3098 days ago

One uses help/about to get a Build Number, and then one looks up the build number on this page:

http://social.technet.microsoft.com/wiki/contents/articles/240.exchange-server-and-update-rollup-build-numbers.aspx

Categories: