Tag Archives: PowerShell

Adding a second Crawl Server in SharePoint 2010 via PowerShell

Here are the steps involved in adding a second crawl server can be done via the Central Admin or PowerShell.
This is perfect if you need a second crawl server for redundancy. The following steps will allow you to add this second crawl server to the existing topology and adding it to the existing crawl database.

Here’s how you do it in the Central Admin:
Search Admin > Modify Search Application Topology> NEW Crawl Component > Select new Server from drop down list, Specify existing crawl database, Specify Temporary location of Index > Click OK and then Click ‘Apply Topology Changes’

Now to do it in PowerShell! The procedure is to clone the existing topology,Create the crawl component, Activate the new cloned topology and delete the old.
Run this on the new crawl server:

# Start the Search service on the server

$SearchSAInstance = Get-SPEnterpriseSearchServiceInstance -local -erroraction SilentlyContinue #Just to mute out the noise if any
Start-SPEnterpriseSearchServiceInstance -Identity $SearchSAInstance

# Retrieve the active topology

$searchSAName = “<Type in the name of your Search Service Application>”

$InitialCrawlTopology = $searchSAName | Get-SPEnterpriseSearchCrawlTopology -Active

$InitialCrawlTopology

# Clone the topology

$CrawlTopology = $searchSAName | New-SPEnterpriseSearchCrawlTopology -Clone -CrawlTopology $InitialCrawlTopology

# Create the new crawl component

$CrawlDatabase0 = ([array]($searchSAName | Get-SPEnterpriseSearchCrawlDatabase))[0]

$searchInstance0 = Get-SPEnterpriseSearchServiceInstance #env:COMPUTERNAME

$CrawlComponent0 = New-SPEnterpriseSearchCrawlComponent -CrawlTopology $CrawlTopology -CrawlDatabase $CrawlDatabase0 -SearchServiceInstance $searchInstance0 -IndexLocation $searchInstance0.DefaultIndexLocation

# Activate the new crawl topology

$CrawlTopology | Set-SPEnterpriseSearchCrawlTopology -Active

Write-Host -ForegroundColor white Waiting for the old crawl topology to become inactive

do {write-host -NoNewline .;Start-Sleep 10;} while ($InitialCrawlTopology.State -ne “Inactive”)
# Delete the old crawl topology

$InitialCrawlTopology | Remove-SPEnterpriseSearchCrawlTopology

Share

SharePoint 2010 Products and Technologies Configuration Wizard in PowerShell

I have been living and breathing SharePoint 2010 PowerShell the past two months.
During this time, I have created PowerShell scripts to prepare the farm, install SharePoint 2010, install and provision all service applications with their custom database names solely with PowerShell. This is on a multi-server SharePoint 2010 environment. So my scripts had to be able to create and join servers to the farm, start relevant services on App servers. No more stsadm for me!

The crawl server (index) was the most interesting as my script creates the Search SA and then modifies it with the specific database names that your variables you provide.

There were some (many) lessons learned and I will write more on that later.
I would like to show you how the SharePoint Products and Technologies Wizard works underneath and then marry those steps with equivalent PowerShell commands….

Read more »

Share

PowerShell Commands for SharePoint 2010

Here are some (over 400) PowerShell™ commands for SharePoint 2010! These can be run remotely (Powershell 2.0).
Stsadm will still be functional in SharePoint 2010. Powershell is not DOS based. Its .NET based. ;)

Windows PowerShell™ is the new command-line interface and scripting language specifically designed for system administrators that will be used for Microsoft® SharePoint® Server 2010 administration. Although both Cmd.exe and Stsadm.exe environments will be maintained for backward compatibility, SharePoint Server 2010 command-line administration will use Windows PowerShell. For practical purposes, you can view Windows PowerShell as complementing Cmd.exe in the Windows administration context and superseding Stsadm.exe for SharePoint administration. You might ask yourself, What’s so unique about Windows PowerShell? Well, unlike most command-line systems that accept and return text, Windows PowerShell supports and uses XML and objects. XML and object support is a pretty major change that brings entirely new tools and methods to greatly improve control, efficiency, and productivity for developers and administrators.

Hope you find these commands useful for the future. Be sure to bookmark this page for future reference.
Read more »

Share

Expand your web server – Free IIS features – URLrewrite, URLrewritevideo streaming, Powershell, URLScan and more!

IIS has greatly changed since I did my MCSE in Windows NT4.0! I did the MCSE+I in the year 2000. The I stood for “Internet” which was essentially IIS.
Now we have IIS 7 and 7.5 and is now built on an open & modular architecture that allows you to customise and add new features through IIS Extensions that are free to use.
Here are some useful extensions that may help you at your work…

Read more »

Share

Free SharePoint 2010 Training webinar: PowerShell Boot Camp – March 25, 2010

SharePoint 2010 is the first version of SharePoint technologies in which Microsoft supports administration through PowerShell scripts. In SharePoint 2007, farm administrators use a command-line utility named STSADM.EXE to run interactive commands from the console window and to write DOS-style batch file scripts to automate common administrative tasks such as creating, backing up or restoring a new site collection.

Microsoft now recommends using the new PowerShell support for writing, testing and executing scripts that automate the same types of administrative tasks that you can accomplish using STSADM.EXE.

Click here to register

Share