Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 7025

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 2162

Deprecated: Hook imagify_allow_picture_tags_for_webp is deprecated since version 2.2! Use imagify_allow_picture_tags_for_nextgen instead. in /www/collab365_296/public/wp-includes/functions.php on line 5758
How to remove the Search Topology (Removing Existing SSA with PowerShell) - Collab365
Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Warning: Undefined array key "url" in /www/collab365_296/public/wp-content/plugins/thrive-visual-editor/thrive-dashboard/inc/smart-site/classes/class-tvd-smart-shortcodes.php on line 85

2015-04-14

This is the script we used for the removal process…

Add-PSSnapin Microsoft.SharePoint.PowerShell

#Removing Existing Search Service Applications

$SSAS = Get-SPEnterpriseSearchServiceApplication

ForEach ($SSA in $SSAS)

{

$SSA | FT Name, ID, ApplicationPool

$Response = Read-Host -Prompt “Would you like to remove the above Search Service Application and all associated search data? Press Y or N”

IF ($Response -eq “y”)

{

Write-Host ‘Removing SSA’ $SSA.Id

$AllProxies = Get-SPEnterpriseSearchServiceApplicationProxy

$Proxy = $AllProxies | ?{$_.GetSearchServiceApplicationInfo().SearchServiceApplicationID -eq $SSA.Id}

Remove-SPEnterpriseSearchServiceApplicationProxy -Identity $Proxy

Remove-SPEnterpriseSearchServiceApplication -Identity $SSA -RemoveData

}

ELSE

{

Write-Host “Skipping SSA Removal”

}

}

#Stop Search Service Instances

$SSIS = Get-SPEnterpriseSearchServiceInstance

ForEach ($SSI in $SSIS)

{

$SSI

$Response = Read-Host -Prompt “Would you like to stop the above service? Press Y or N”

IF ($Response -eq “Y”)

{

Write-Host ‘Stopping’ $SSIS.Service ‘on’ $SSIS.Server

Stop-SPEnterpriseSearchServiceInstance -Identity $SSI

}

}

#Stop Search Query and Site Settings Service Instances

$SQSSSIS = Get-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance

ForEach ($SQSSSI in $SQSSSIS)

{

$SQSSSI

$Response = Read-Host -Prompt “Would you like to stop the above service? Press Y or N”

IF ($Response -eq “Y”)

{

Write-Host ‘Stopping’ $SQSSsI.Service ‘on’ $SQSsSI.Server

Stop-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance -Identity $SQSsSI

}

}

#Check Service Status

Get-SPEnterpriseSearchServiceInstance | FT Server, Status

Get-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance | FT Server, Status

 

(Visited 1,067 times, 1 visits today)

About the author 

Tony Di Leonardo

Summit Bundle

Get 200+ hours of Microsoft 365 Training for 27$!

Master Office 365, Power Platform & SharePoint & Teams With 200+ Hours Of Training Videos and 108 Ebooks in the Collab365 Academy. This offer is insane and is only available for a limited period.