Automating deployment of complex search service application topology


Recently my client expressed a desire to automate deployment of search service application with not so ordinary topology 😉

The script needed to be flexible and reusable for other environments (DR, Test).

So here is the PowerShell script which uses input from XML configuration file to implement any desired search service topology.  

It also includes process of testing index path and create index location if doesn't exist.

#Below is the XML configuration file example and the PowerShell script for download.

<?xml version="1.0"?>
<SearchServiceApplication>
 <SearchApplicationPool Name="SearchApplicationPool" AppPoolAcc="contoso\svc_spsl"/>
  <SearchServiceApplicationName SearchAppName="SharePoint Search Service" SearchProxyName="Sharepoint Search Service Proxy" />
  <DatabaseServer DBServerName="contoso_sql" DBName="contoso_search_SearchAdmin"/>
   <SearchServers>
    <SearchServer ServerName="contoso_app_106" IndexPath="F:\" IndexDirectoryName="Search Index" AdminComponent="False" AnalyticsProcessingComponent="False" ContentProcessingComponent="False" QueryProcessingComponent="False" CrawlComponent="False" IndexComponent="True" IndexPartition="0"  />
    <SearchServer ServerName="contoso_app_107" IndexPath="F:\" IndexDirectoryName="Search Index" AdminComponent="False" AnalyticsProcessingComponent="False" ContentProcessingComponent="False" QueryProcessingComponent="False" CrawlComponent="False" IndexComponent="True" IndexPartition="1"  />
    <SearchServer ServerName="contoso_app_108" IndexPath="F:\" IndexDirectoryName="Search Index" AdminComponent="False" AnalyticsProcessingComponent="False" ContentProcessingComponent="False" QueryProcessingComponent="False" CrawlComponent="False" IndexComponent="True" IndexPartition="2"  />
    <SearchServer ServerName="contoso_app_109" IndexPath="F:\" IndexDirectoryName="Search Index" AdminComponent="False" AnalyticsProcessingComponent="False" ContentProcessingComponent="False" QueryProcessingComponent="False" CrawlComponent="False" IndexComponent="True" IndexPartition="3"  />
    <SearchServer ServerName="contoso_app_110" IndexPath="F:\" IndexDirectoryName="Search Index" AdminComponent="False" AnalyticsProcessingComponent="False" ContentProcessingComponent="False" QueryProcessingComponent="False" CrawlComponent="False" IndexComponent="True" IndexPartition="4"  />
    <SearchServer ServerName="contoso_web_56" IndexPath="" IndexDirectoryName="SearchIndex" AdminComponent="False" AnalyticsProcessingComponent="False" ContentProcessingComponent="False" QueryProcessingComponent="True" CrawlComponent="False" IndexComponent="false" IndexPartition=""  />
    <SearchServer ServerName="contoso_web_57" IndexPath="" IndexDirectoryName="SearchIndex" AdminComponent="False" AnalyticsProcessingComponent="False" ContentProcessingComponent="False" QueryProcessingComponent="True" CrawlComponent="False" IndexComponent="false" IndexPartition=""  />
    <SearchServer ServerName="contoso_web_58" IndexPath="" IndexDirectoryName="SearchIndex" AdminComponent="False" AnalyticsProcessingComponent="False" ContentProcessingComponent="False" QueryProcessingComponent="True" CrawlComponent="False" IndexComponent="false" IndexPartition=""  />
    <SearchServer ServerName="contoso_web_59" IndexPath="" IndexDirectoryName="SearchIndex" AdminComponent="False" AnalyticsProcessingComponent="False" ContentProcessingComponent="False" QueryProcessingComponent="True" CrawlComponent="False" IndexComponent="false" IndexPartition=""  />
    <SearchServer ServerName="contoso_app_126" IndexPath="" IndexDirectoryName="SearchIndex" LocalIndexPath="" AdminComponent="False" AnalyticsProcessingComponent="True" ContentProcessingComponent="True" QueryProcessingComponent="False" CrawlComponent="False" IndexComponent="False" IndexPartition="" />
    <SearchServer ServerName="contoso_app_127" IndexPath="" IndexDirectoryName="SearchIndex" LocalIndexPath="" AdminComponent="False" AnalyticsProcessingComponent="True" ContentProcessingComponent="True" QueryProcessingComponent="False" CrawlComponent="False" IndexComponent="False" IndexPartition="" />
    <SearchServer ServerName="contoso_app_128" IndexPath="" IndexDirectoryName="SearchIndex" LocalIndexPath="" AdminComponent="False" AnalyticsProcessingComponent="True" ContentProcessingComponent="True" QueryProcessingComponent="False" CrawlComponent="False" IndexComponent="False" IndexPartition="" />
   </SearchServers>
</SearchServiceApplication>

SearchServiceApplicationDeployment.zip

Comments (1)

  1. Azwar says:

    This is very useful, thanks for sharing!

Skip to main content