New-SPEnterpriseSearchIndexComponent checks the existence of RootDirectory in the wrong server

You want to add a new index component to the search topology, and want to specify a non-default root directory for the index files. For example:

New-SPEnterpriseSearchIndexComponent -SearchTopology $t -SearchServiceInstance $ssi -IndexPartition 1 -RootDirectory “”d:\index4”

The cmdlet might fail with the following error message because it incorrectly checks if the indicated root directory exists on the server the cmdlet is run on:

Cannot bind parameter ‘RootDirectory’ to the target. Exception setting “”RootDirectory””: “”Could not find a part of the path ‘d:\index4’.”

Workaround    You can create the new index component using the following procedure instead:

$host02 = (Get-SPServer”<Name of server>”).Name

$ssa = Get-SPEnterpriseSearchserviceApplication

$t = $ssa.ActiveTopology.Clone()

$ic = (New-Object Microsoft.Office.Server.Search.Administration.Topology.IndexComponent $host02,1);

$ic.RootDirectory =””d:\index4″

$t.AddComponent($ic)”

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s