Category: Servers

Windows Search Server: initiate crawls by command line and scheduled task
article #965, updated 326 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:   Servers   Sharepoint

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

Disable WSUS in SBS 2011
article #910, updated 417 days ago

Completion of these steps will free up a lot of resources on an SBS. You will need to have a different method (e.g., Labtech, many others) to keep client machines up to date.

  1. Run (install first if not present) the SQL Server Management Studio.
  2. Connect the Studio, to type Database Engine, server name \\.\pipe\mssql$microsoft##ssee\sql\query
  3. In the Studio, under Databases, you will find an item “SUSDB”.
  4. If you don’t know where the database files are held, find them using the properties of that item.
  5. Run an SQL query to get a list of connections: EXEC sp_who2
  6. Run SQL query/ies to kill all connections to DBName SUSDB only, using the SPIDs, e.g., KILL 999
  7. Right-click SUSDB, “Delete” SUSDB, and close the Studio.
  8. Delete the database files and all of the update files.
  9. Disable the WSUS-related items in services.msc and IIS.

The above is digested from the following:

https://social.technet.microsoft.com/Forums/en-US/d7f5d5bb-6623-4d46-80e6-421674a46829/remove-wsus-from-sbs2011-server?forum=smallbusinessserver

http://blog.mpecsinc.ca/2011/07/sbs-2011-wsus-sql-memory-usage-is-very.html

Categories:   Servers   

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

Windows Server Essentials integration with Office 365
article #916, updated 484 days ago

If it’s not working or not working well for you, try this:

  1. In the Dashboard, Disable Office 365 integration and Azure integration. It’s two separate steps. If you disable just Office 365 integration you won’t be able to continue.
  2. Set up Office 365 integration.
  3. See lots of interesting information come up quite quicly, in the Office 365 tab after you restart the Dashboard, to confirm that your integration is working very nicely.
  4. If it didn’t work well, open your firewall per Microsoft, and test again.

Categories:   Office 365   Servers

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

Analyze disk space usage on Windows servers
article #907, updated 501 days ago

The following is highly recommended on Windows servers:

http://windirstat.info/

Categories:   Servers   

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

A Raspberry Pi 2 makes a great roll-your-own DropBox server / microNAS
article #852, updated 566 days ago

The great open-source tool Syncthing works very well for private DropBox-class capability, including optional file-multiversioning at one or more sync locations. I have some very used PC hardware which would work well enough for this, but then I was thinking, I could save the cost of a 24/7 150W light bulb at the very least, if my cute little Raspberry Pi 2 could do the job.

The end of the story is already here; it’s working beautifully. Here’s the elements I am using:

  • One Raspberry Pi 2 with Raspbian installed in default fashion on its bundled microSD card, good passwords set, and fully up to date, including firmware. I have been finding considerable performance boosts with update of firmware, so I definitely recommend it.
  • One USB flash drive big enough to hold your sync archive with satisfactory free space. It might work with a USB hard drive, but it didn’t work with my OEM-portablized Hitachi TravelStar, too much power demand…although I did limit the power use of the whole rig by using one 2.1A double-USB cell-phone charger for everything! :-) I’m now using a 32-gigabyte LEXAR USB flash drive, the archive is currently 17.5G.
  • Wire or wireless to the Internet connection. I have not seen a major performance hit from wireless, but then again I’m using a pretty beefy wireless router and my wifi environment is not choked.
  • The USB flash drive formatted BTRFS. (One does the format using mkfs.btrfs, and then sets the /etc/fstab for automount and auto-check at boot.) This is important, because one can find quite a large number of reports of USB flash drives failing when used as OS drives under ext3, ext4, and NTFS. I first set it all up using NTFS on the flash drive, and had noticed the flash drive’s LED flashing frankly all of the time, even in moments when there was no traffic according to Syncthing, and the incoming stream was forced to pause a lot. That concerned me, so I tried it in ext4, and it was just about as bad. So I did a bit of research, found the many reports of failures, found multiple flash-specific filesystems all of which admitted of various different downsides which I didn’t like very much, set it up again using BTRFS, and was really amazed. The LED went off a whole lot less, and the effective incoming bandwidth during full sync literally doubled, ~1-1.5M/s to ~3-3.8M/s depending on the moment, and no pauses visible.
  • Special BTRFS attributes set up in /etc/fstab. I set these and did a reboot after the full sync was about one-third done, and was yet more amazed. Even when full sync was going on, the LED did not and does not flash more than a half-second or so every once in a long while, and incoming stream bandwidth remains very nice. I’m using ssd_spread, noatime, and space_cache. A USB stick can’t really count as an SSD because its circuitry hides a lot of things from the OS, so the attribute “ssd” does not take effect if set, but these three work just fine and should keep it running as long and reliably as possible.

Here it is on my bench at home, doing its so-quiet production work, not moved yet to its permanent location. Everything except the (temporary) screen is visible, the “power supply” is plugged into a two-prong extension cord; and those are CD blanks in the corner for a size comparison :-)

a pic of my little microNAS

Try it, you’ll like it! :-)

More methods of the same, not tested yet:

https://www.seafile.com

Categories:   Servers   New and Interesting Apps

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

Trouble connecting to Server 2012 (SMB 3.0)
article #876, updated 571 days ago

Lots of devices and old PCs have trouble connecting to Server 2012, because Server 2012 uses SMB 3.0, and older devices often use SMB 1.0. There is a way:

http://xenomorph.net/windows/issues/windows-xp-cannot-connect-to-2012-r2-file-shares/

Categories:   Servers   

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

Remote Web Workplace freezes and failures
article #851, updated 585 days ago

RWW often freezes and fails. Happily, the amazing Jared Dexter found a fix: when memory usage reaches a certain high degree, IIS refuses to cooperate, and we can change this. In an administrative CMD:

  1. CD to %ProgramFiles%\Windows Small Business Server\Bin\WebApp\RemoteAccess
  2. Open the file web.config, using Notepad
  3. In web.config, search for item <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
  4. Change the item to <serviceHostingEnvironment aspNetCompatibilityEnabled="true" minFreeMemoryPercentageToActivateService="0" />
  5. Save and close
  6. Run IISRESET.

The above is summarized from:

http://blogs.technet.com/b/sbs/archive/2014/01/13/troubleshooting-an-unexpected-error-occurred-message-when-using-remote-web-access-to-connect-to-computers.aspx

Categories:   Servers   

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

Installing the GUI onto Windows Server 2012 Core
article #853, updated 606 days ago

The indefatigable Matt Quick provides thus:

http://prajwaldesai.com/switching-between-gui-and-server-core-in-windows-server-2012/

Categories:   Servers   Windows OS-Level Issues

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

Current version of PHP on CentOS and RHEL
article #850, updated 633 days ago

Here is a source:

https://webtatic.com/packages/php55/

Categories:   Web Servers   Servers

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

Tuning Windows Servers for Performance
article #814, updated 747 days ago

Interesting material here:

https://msdn.microsoft.com/en-us/library/windows/hardware/dn529134

Categories:   Servers