When performing a multi-server SharePoint 2013 farm install using AutoSPInstaller where the AutoSPInstallerInput.xml file is configured with <RemoteInstall Enable="true">, it is possible in certain scenarios for some servers to be ignored during PowerShell remoting. This leaves the ignored servers unjoined to the farm and could leave those search roles unprovisioned in search and could leave the search service provisioning incomplete with errors. AutoSPInstaller, during execution could throw exceptions such as:
```
The search service is not able to connect to the machine that hosts the administration component. Verify that the
administration component '14964787-a7e8-4c38-aed0-ef1cf7eb3cc7' in search application 'Search Service Application' is
in a good state and try again.
```
I've discovered this scenario to be the case when the server names are only mentioned in the AutoSPInstallerInput.xml file in the EnterpriseSearchService element for the following roles:
```
<!-- IndexComponent is only required for SP2013 -->
<IndexComponent>
<Server Name="SERVERX" />
<Server Name="SERVERY" />
</IndexComponent>
<!-- ContentProcessingComponent is only required for SP2013 -->
<ContentProcessingComponent>
<Server Name="SERVERX" />
<Server Name="SERVERY" />
</ContentProcessingComponent>
<!-- AnalyticsProcessingComponent is only required for SP2013 -->
<AnalyticsProcessingComponent>
<Server Name="SERVERZ" />
</AnalyticsProcessingComponent>
```
In this case, during PowerShell remoting, SERVERX, SERVERY and SERVER Z would be skipped and would not be joined to the farm and would not have their roles provisioned to the farm.
I took a look at the code for the __Get-FarmServers__ function in the __AutoSPInstallerFunction.ps1__ file which enumerates farms servers and found that it only looks at the following components in search:
```
foreach ($serverElement in $node.CrawlComponent.Server) {$crawlServers += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.QueryComponent.Server) {$queryServers += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.SearchQueryAndSiteSettingsServers.Server) {$siteQueryAndSSServers += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.AdminComponent.Server) {$adminServers += @($serverElement.GetAttribute("Name"))}
$servers = $crawlServers+$queryServers+$siteQueryAndSSServers+$adminServers
```
For testing, I modified the code to the below and verified that the function did then return these servers from the function and included them in the return value from the function.
```
foreach ($serverElement in $node.CrawlComponent.Server) {$crawlServers += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.QueryComponent.Server) {$queryServers += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.SearchQueryAndSiteSettingsServers.Server) {$siteQueryAndSSServers += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.AdminComponent.Server) {$adminServers += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.IndexComponent.Server) {$testIndexComponent += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.ContentProcessingComponent.Server) {$testContentProcessingComponent += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.AnalyticsProcessingComponent.Server) {$testAnalyticsProcessingComponent += @($serverElement.GetAttribute("Name"))}
$servers = $crawlServers+$queryServers+$siteQueryAndSSServers+$adminServers+$testIndexComponent+$testContentProcessingComponent+$testAnalyticsProcessingComponent
```
I hope this post makes sense. Please let me know if you have any questions.
```
The search service is not able to connect to the machine that hosts the administration component. Verify that the
administration component '14964787-a7e8-4c38-aed0-ef1cf7eb3cc7' in search application 'Search Service Application' is
in a good state and try again.
```
I've discovered this scenario to be the case when the server names are only mentioned in the AutoSPInstallerInput.xml file in the EnterpriseSearchService element for the following roles:
```
<!-- IndexComponent is only required for SP2013 -->
<IndexComponent>
<Server Name="SERVERX" />
<Server Name="SERVERY" />
</IndexComponent>
<!-- ContentProcessingComponent is only required for SP2013 -->
<ContentProcessingComponent>
<Server Name="SERVERX" />
<Server Name="SERVERY" />
</ContentProcessingComponent>
<!-- AnalyticsProcessingComponent is only required for SP2013 -->
<AnalyticsProcessingComponent>
<Server Name="SERVERZ" />
</AnalyticsProcessingComponent>
```
In this case, during PowerShell remoting, SERVERX, SERVERY and SERVER Z would be skipped and would not be joined to the farm and would not have their roles provisioned to the farm.
I took a look at the code for the __Get-FarmServers__ function in the __AutoSPInstallerFunction.ps1__ file which enumerates farms servers and found that it only looks at the following components in search:
```
foreach ($serverElement in $node.CrawlComponent.Server) {$crawlServers += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.QueryComponent.Server) {$queryServers += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.SearchQueryAndSiteSettingsServers.Server) {$siteQueryAndSSServers += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.AdminComponent.Server) {$adminServers += @($serverElement.GetAttribute("Name"))}
$servers = $crawlServers+$queryServers+$siteQueryAndSSServers+$adminServers
```
For testing, I modified the code to the below and verified that the function did then return these servers from the function and included them in the return value from the function.
```
foreach ($serverElement in $node.CrawlComponent.Server) {$crawlServers += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.QueryComponent.Server) {$queryServers += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.SearchQueryAndSiteSettingsServers.Server) {$siteQueryAndSSServers += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.AdminComponent.Server) {$adminServers += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.IndexComponent.Server) {$testIndexComponent += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.ContentProcessingComponent.Server) {$testContentProcessingComponent += @($serverElement.GetAttribute("Name"))}
foreach ($serverElement in $node.AnalyticsProcessingComponent.Server) {$testAnalyticsProcessingComponent += @($serverElement.GetAttribute("Name"))}
$servers = $crawlServers+$queryServers+$siteQueryAndSSServers+$adminServers+$testIndexComponent+$testContentProcessingComponent+$testAnalyticsProcessingComponent
```
I hope this post makes sense. Please let me know if you have any questions.