Today I got an error while creating a Search Service Application for SharePoint 2013:
PS C:\> $SearchSA = New-SPEnterpriseSearchServiceApplication –Name “Enterprise Search Service Application” –ApplicationPool “Search App Pool” –DatabaseName “Search”
New-SPEnterpriseSearchServiceApplication : Value cannot be null.
Parameter name: indexLocation
To resolve this I just started the Search Service Instance on each (search) server in the farm and set it’s “DefaultIndexLocation” property.
After that I could create the Search Service App.
PS snippet:
"SearchServer1", "SearchServer2" | % {
$svcInst = (Get-SPServer -Identity $_).serviceinstances | ? { $_.GetType().FullName -eq "Microsoft.Office.Server.Search.Administration.SearchServiceInstance" }
$svcInst.DefaultIndexLocation = $defaultIndexLocation
$svcInst.Update()
$svcInst.Provision()
}
This did it.
Hi Ingo,
I got the same error message when trying to install the search service via PS.
I have 1 App server where I am trying to setup search.
Im not an expert on Powershell yet:p
What would the code be for just one search server named?
Thanks in advanced, im just stuck on this:s
Best regards Bjorn
Just type only one server name in this line.
“SearchServer1” | % {
Anything else is the same.
Regards,
Ingo
Hi Thanks for your reply!
One mor equestion:-)
FullName -eq “Microsoft.Office.Server.Search.Administration.SearchServiceInstance”
This fullname is this a default name or did you choose it?
br
Bjorn
This is the type name out of the assemlby. It will “always” be the same. So also on a system with language pack this would work because the type name is not localized.
Thanks again ! Works great 😀
I am running your commands, not in PS1 but seperately. When I use $svcInst.DefaultIndexLocation = $defaultIndexLocation i get following error
“Property ‘DefaultIndexLocation’ cannot be found on this object; make sure it exists and is settable.”
I checked $svcInst object and did not find DefaultIndexLocation method in it.
Please Help