0

I'm working on creating a SP2013 search service application based on Todd Klindt's work (http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=378). It worked down to the line New-SPEnterpriseSearchAdminComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance. I've modified the $clone and $searchserviceinstance from what he has to:

$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone -SearchTopology $active
write-host "we have a clone"
$searchServiceInstance = Get-SPEnterpriseSearchServiceInstance
write-host "we have a search service instance"

The two write-host commands print out fine, but when I get to the next line, New-SPEnterpriseSearchAdminComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance, I get an error:

New-SPEnterpriseSearchAdminComponent : A positional parameter cannot be found that 
accepts argument 'â?SearchTopology TopologyId:
61b33981-a905-44f7-8000-eaa40e7b4676, CreationDate: 12/19/2014 2:18:35 PM,
State: Inactive, Components:  -SearchServiceInstance SearchServiceInstance

2 Answers 2

1

Before you create the service components you have to start the service instance on your server(s).

$hostA = Get-SPEnterpriseSearchServiceInstance -Identity “server-name”

Start-SPEnterpriseSearchServiceInstance -Identity $hostA

then go on with your code. example below

$ssa = Get-SPEnterpriseSearchServiceApplication
$newTopology = New-SPEnterpriseSearchTopology -SearchApplication $ssa

- Wait until the services become online (about 5 minutes)

New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostA

Hope this helps.

0
1
  1. Your specific error was due to $clone not getting populated when you called the New-SPEnterpriseSearchTopology command. I think the command will add the topology to the $ssa.Topology list, but not necessarily return a copy of the SPEnterpiseSearchTopology object.

Instead of:

$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone -SearchTopology $active

Use:

$clone = $ssa.ActiveTopology.Clone()

Todd's original code included below for reference:

# Based on scripts at http://www.harbar.net/articles/sp2013mt.aspx
# Thanks Spence!

# Get App Pool
$saAppPoolName = "Default SharePoint Service App Pool"

# Search Specifics, we are single server farm
$searchServerName = (Get-ChildItem env:computername).value
$serviceAppName = "Search Service Application"
$searchDBName = "SearchService_DB"


# Grab the Appplication Pool for Service Application Endpoint
$saAppPool = Get-SPServiceApplicationPool $saAppPoolName

# Start Search Service Instances
Write-Host "Starting Search Service Instances..."
Start-SPEnterpriseSearchServiceInstance $searchServerName
Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance $searchServerName

# Create the Search Service Application and Proxy
Write-Host "Creating Search Service Application and Proxy..."
$searchServiceApp = New-SPEnterpriseSearchServiceApplication -Name $serviceAppName -ApplicationPool $saAppPoolName -DatabaseName $searchDBName
$searchProxy = New-SPEnterpriseSearchServiceApplicationProxy -Name "$serviceAppName Proxy" -SearchApplication $searchServiceApp

# Clone the default Topology (which is empty) and create a new one and then activate it
Write-Host "Configuring Search Component Topology..."
$clone = $searchServiceApp.ActiveTopology.Clone()
$searchServiceInstance = Get-SPEnterpriseSearchServiceInstance
New-SPEnterpriseSearchAdminComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance
New-SPEnterpriseSearchContentProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance
New-SPEnterpriseSearchAnalyticsProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance 
New-SPEnterpriseSearchCrawlComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance 
New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance
New-SPEnterpriseSearchQueryProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance
$clone.Activate()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.