Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Add-PSSnapin *share* -ErrorAction SilentlyContinue
- #Find the Search Service that we are changing the topology - note the ID
- Get-SPEnterpriseSearchServiceApplication
- #----------------------step1----------------------------------------------#
- write "please run only step 1"
- #variables
- $q3="SD5-Query03"
- $q4="SD5-Query04"
- $ssaID = <INSERT_Search_Service_GUID_HERE>
- $hostC = Get-SPEnterpriseSearchServiceInstance -Identity $q3
- $hostD = Get-SPEnterpriseSearchServiceInstance -Identity $q4
- $ssa = Get-SPEnterpriseSearchServiceApplication -Identity $ssaID
- $active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
- $clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone -SearchTopology $active
- #add index partition 1 to query servers
- New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -SearchServiceInstance $hostC -RootDirectory "E:\SP13_Index01" -IndexPartition 1
- New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -SearchServiceInstance $hostD -RootDirectory "E:\SP13_Index01" -IndexPartition 1
- #activate topology
- $clone.Activate()
- #-------------------------step2 - RUN ONLY AFTER THE NEW SEARCH SEARVICE IS IN PRODUCTION-------#
- #Find the OLD Search Service that we are REMOVING - note the ID
- Get-SPEnterpriseSearchServiceApplication
- #variables
- $wfePrefix = "SD5-FE"
- $ssaID = <INSERT_OLD_Search_Service_GUID_HERE>
- $answer=read-host "Are you sure you want to run step 2? y/n"
- if($answer -eq "y")
- {
- $ssa = Get-SPEnterpriseSearchServiceApplication -Identity $ssaID
- $active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
- $clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone -SearchTopology $active
- #remove search components from WFEs
- Get-SPEnterpriseSearchComponent -SearchTopology $clone | ? {$_.ServerName -like "*$wfePrefix*"} | %{
- Remove-SPEnterpriseSearchComponent -Identity $_.ComponentId.GUID -SearchTopology $clone -Confirm:$false
- }
- #activate topology
- $clone.Activate()
- #stop search services on WFEs
- Get-SPEnterpriseSearchServiceInstance | ? server -like "*$wfePrefix*" | Stop-SPEnterpriseSearchServiceInstance
- Get-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance | ? server -like "*$wfePrefix*" | Stop-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement