New-SPEnterpriseSearchServiceApplication : Value cannot be null.

Got this exception when creating a search service application in a multi-server farm:

New-SPEnterpriseSearchServiceApplication : Value cannot be null.

Parameter name: indexLocation

Found the resolution in this TechNet forum post: SharePoint 2013 (RTM) Powershell New-SPEnterpriseSearchApplicationService error about non-existent “indexlocation” parameter ??

The solution in my case wasn’t the accepted answer, rather the answer from iftvio suggesting to start the search and query service instances. This answer was counter-intuitive to me because I was running the script from a server that wasn’t part of the search topology.

Let me explain.

New-SPEnterpriseSearchServiceApplication

In this particular farm, I had the search components dedicated to a specific server. I was running the script from another server in the farm. In my scripts I start the search and query instances on the servers specified in a configuration file. Since the server I was running the scripts from wasn’t a search server it wasn’t in the list of servers on which to start the service instances. It turns out though, that New-SPEnterpriseSearchServiceApplication expects these service instances to be running on the current server.

To start the instances, use Start-SPEnterpriseSearchServiceInstance and Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance

In the end my topology is what I expected, I just stopped the service instances once I was done configuring search.

Summary: When running New-SPEnterpriseSearchServiceApplication make sure the server is running the search and query service instances.

Share Button