How To: Remove a Content Source using PowerShell

Note: The account that will run this script has to be a Search Service Application administrator.

  • Open a new PowerShell window as an Administrator.
  • Run the RemoveContentSource.ps1 script
    • ./RemoveContentSource.ps1 -ContentSource "MyContentSource" -Context "http://my-sp2013-central-admin:port" -IntermediateRepository "C:\IntermediateRepository -SearchAppName "My Search Service Application"

How To: Remove a Content Source Manually

  • Remove the Content Source:
    • Go to Central Administration and click on Manage Service Applications.
    • Look for the Search Service Application and click on it.
    • Go to Content Sources.
    • Look for the content source you want to delete, right click it and select "Delete".

Note: If the content source is currently crawling, the delete option will be disabled. Stop the crawl process or wait for it to finish to be able to delete it.

  • Remove the BDC Model:
    • Go to Central Administration and click on Manage Service Applications.
    • Look for the Business Data Connectivity Service Application and click on it.
    • On the ribbon, go to the View section and select "BDC Models".
    • Right click on the BDC model you want to delete ({contentSourceName}-Model), right click it and select "Delete".
  • Remove the Repository folder for the content source:
    • Go to the Intermediate Repository
    • Remove the folder with the same name as the content source.

Note:A new Content Source and External Content Type with a name used previously will only be created if the folder has been removed from the Shared Repository directory.

  • No labels