SP2010/Search: PowerShell cmdlets

SP2010/Search: PowerShell cmdlets

This is a repost of an older Blog Article I found some time ago. To run these commands, you have to start PowerShell with the SharePoint extensions or just call up the SharePoint 2010 management shell. Furthermore, you need to be admin on the config DB.

 

In SharePoint 2010, Seach is composed of several components, all of which provide specific functionality that is required for Search to operate. These components can be configured by using Windows PowerShell cmdlets.

The following cmdlets are available for Microsoft SharePoint Server 2010.

Administration

SPEnterpriseSearchAdministrationComponent

  • Get-SPEnterpriseSearchAdministrationComponent. Returns the administration component for a shared search application. Use the Get-SPEnterpriseSearchAdmininstrationComponent cmdlet to retrieve an administration component for a search service application in order to update or delete it.
  • Set-SPEnterpriseSearchAdministrationComponent. Sets properties of an administration component for a shared search application. The Set-SPEnterpriseSearchAdministrationComponent cmdlet updates properties of an AdministrationComponent object for a search service application.

Crawling

SPEnterpriseSearchCrawlComponent

  • Get-SPEnterpriseSearchCrawlComponent. Returns a crawl component for a shared search application.
  • New-SPEnterpriseSearchCrawlComponent. Creates a crawl component for a shared search application.The New-SPEnterpriseSearchCrawlComponent cmdlet is run when the search functionality is initially configured, or when a new crawl component is added to a crawl topology for a shared search application. A crawl topology can contain multiple crawl components.
  • Remove-SPEnterpriseSearchCrawlComponent. Deletes a crawl component from a shared search application. The Remove-SPEnterpriseSearchCrawlComponentAdmin cmdlet deletes a specified crawl component from a shared service application.

SPEnterpriseSearchCrawlContentSource

  • Get-SPEnterpriseSearchCrawlContentSource. Returns a crawl content source.
  • New-SPEnterpriseSearchCrawlContentSource. Creates a new crawl content source for a shared search application.
  • Remove-SPEnterpriseSearchCrawlContentSource. Deletes a specified crawl content source from a search application. The Remove-SPEnterpriseSearchCrawlComponentAdmin cmdlet deletes a specified crawl component from a shared service application.
  • Set-SPEnterpriseSearchCrawlContentSource. Sets the properties of a crawl content source for a shared search application.

SPEnterpriseSearchCrawlCustomConnector

  • Get-SPEnterpriseSearchCrawlCustomConnector. Returns a CustomConnector object type.
  • New-SPEnterpriseSearchCrawlCustomConnector. Registers a protocol for custom crawling.
  • Remove-SPEnterpriseSearchCrawlCustomConnector. Removes a CustomConnector object.

SPEnterpriseSearchCrawlDatabase

  • Get-SPEnterpriseSearchCrawlDatabase. Returns a crawl store.
  • New-SPEnterpriseSearchCrawlDatabase. Adds a crawl store to a shared search application.
  • Remove-SPEnterpriseSearchCrawlDatabase. Deletes a content crawl store.
  • Set-SPEnterpriseSearchCrawlDatabase. Sets properties of a crawl database for a search service application.

SPEnterpriseSearchCrawlExtension

  • Get-SPEnterpriseSearchCrawlExtension. Returns the extension rule for the extension collection.
  • New-SPEnterpriseSearchCrawlExtension. Adds an extension rule to a shared search application.
  • Remove-SPEnterpriseSearchCrawlExtension. Removes a file name extension from the list of files that can be crawled.

SPEnterpriseSearchCrawlMapping

  • Get-SPEnterpriseSearchCrawlMapping. Returns a crawl mapping for the search application.
  • New-SPEnterpriseSearchCrawlMapping. Creates a crawl mapping rule for a shared search application.
  • Remove-SPEnterpriseSearchCrawlMapping. Deletes a crawl mapping.

SPEnterpriseSearchCrawlRule

  • Get-SPEnterpriseSearchCrawlRule. Output a CrawlRule Object.
  • New-SPEnterpriseSearchCrawlRule. Output a CrawlRule Object.
  • Remove-SPEnterpriseSearchCrawlRule. Output a CrawlRule Object.
  • Set-SPEnterpriseSearchCrawlRule. Output a CrawlRule Object.

SPEnterpriseSearchCrawlTopology

  • Get-SPEnterpriseSearchCrawlTopology. Returns a crawl topology.
  • New-SPEnterpriseSearchCrawlTopology. Adds a crawl topology to a shared search application.
  • Remove-SPEnterpriseSearchCrawlTopology. Deletes a crawl topology.
  • Set-SPEnterpriseSearchCrawlTopology. Sets the properties of a crawl topology on a shared search application.

Microsoft FAST Search Server 2010 for SharePoint

Microsoft FAST Search Server 2010 for SharePoint can replace SharePoint Server search features in environments where scale and performance requirements exceed the capabilities of SharePoint Server search. FAST Search Server 2010 for SharePoint can be deployed across multiple servers for redundancy and to increase performance and capacity. Deployment and management take place primarily through command-line operations — not the SharePoint Central Administration Web site — and can be scripted by using Windows PowerShell. FAST Search Server 2010 for SharePoint is only available with a SharePoint Server Enterprise Client Access License (CAL).

SPEnterpriseSearchExtendedClickThroughExtractorJobDefinition

  • Get-SPEnterpriseSearchExtendedClickThroughExtractorJobDefinition. Gets an object representing the click-through extractor-job instance of a FAST Search for SharePoint specific search service application.

SPEnterpriseSearchExtendedConnectorProperty

  • Get-SPEnterpriseSearchExtendedConnectorProperty. Returns the value of the property of the Search Service Application.
  • Set-SPEnterpriseSearchExtendedConnectorProperty. Sets the value of an ExtendedConnector object.

SPEnterpriseSearchExtendedQueryProperty

  • Get-SPEnterpriseSearchExtendedQueryProperty.
  • Set-SPEnterpriseSearchExtendedQueryProperty. Sets FAST Search for SharePoint service specific properties.

General

SPEnterpriseSearchIndexPartition

  • Get-SPEnterpriseSearchIndexPartition. Returns an index partition for a query topology.
  • Set-SPEnterpriseSearchIndexPartition. Sets properties of an index partition for a query topology.

SPEnterpriseSearchLanguageResourcePhrase

  • Get-SPEnterpriseSearchLanguageResourcePhrase. Returns a language resource phrase.
  • New-SPEnterpriseSearchLanguageResourcePhrase. Adds a language resource phrase to a shared search application.
  • Remove-SPEnterpriseSearchLanguageResourcePhrase. Deletes a language resource phrase from a shared search application.

SPEnterpriseSearchPropertyDatabase

  • Get-SPEnterpriseSearchPropertyDatabase. Returns a property store.
  • New-SPEnterpriseSearchPropertyDatabase. Adds a new property store to a shared search application.
  • Remove-SPEnterpriseSearchPropertyDatabase. Deletes a property store.
  • Set-SPEnterpriseSearchPropertyDatabase. Modifies properties for a property store.

SPEnterpriseSearchSiteHitRule

  • Get-SPEnterpriseSearchSiteHitRule. Returns shared site hit rule.
  • New-SPEnterpriseSearchSiteHitRule. Output an SiteHitRule Object.
  • Remove-SPEnterpriseSearchSiteHitRule. Output an SiteHitRule Object.

Metadata

SPEnterpriseSearchMetadataCategory

  • Get-SPEnterpriseSearchMetadataCategory. Returns a crawled property category.
  • New-SPEnterpriseSearchMetadataCategory. Adds a crawled property category to a shared search application.
  • Remove-SPEnterpriseSearchMetadataCategory. Deletes a crawled property category.
  • Set-SPEnterpriseSearchMetadataCategory. Sets properties of a crawled property category for a shared search application.

SPEnterpriseSearchMetadataCrawledProperty

  • Get-SPEnterpriseSearchMetadataCrawledProperty. Returns a crawled property.
  • New-SPEnterpriseSearchMetadataCrawledProperty. Adds a crawled property category to a shared search application.
  • Set-SPEnterpriseSearchMetadataCrawledProperty. Sets the properties of a metadata crawled property for a shared search application.

SPEnterpriseSearchMetadataManagedProperty

  • Get-SPEnterpriseSearchMetadataManagedProperty. Returns a managed property.
  • New-SPEnterpriseSearchMetadataManagedProperty. Adds a managed property to a shared search application.
  • Remove-SPEnterpriseSearchMetadataManagedProperty. Deletes a metadata managed property.
  • Set-SPEnterpriseSearchMetadataManagedProperty. Sets the properties of a metadata managed property.

SPEnterpriseSearchMetadataMapping

  • Get-SPEnterpriseSearchMetadataMapping. Returns the current state of a managed property mapping.
  • New-SPEnterpriseSearchMetadataMapping. Adds a managed property mapping to a shared search application.
  • Remove-SPEnterpriseSearchMetadataMapping. Deletes a metadata mapping from a managed property.
  • Set-SPEnterpriseSearchMetadataMapping. Sets the properties of a managed property mapping for a shared search application. 

Querying 

SPEnterpriseSearchQueryAuthority

  • Get-SPEnterpriseSearchQueryAuthority. Returns an authoritative page.
  • New-SPEnterpriseSearchQueryAuthority. Adds an authoritative page to a shared search application.
  • Remove-SPEnterpriseSearchQueryAuthority. Deletes an authoritative page.
  • Set-SPEnterpriseSearchQueryAuthority. Sets the properties of an authoritative page for a shared search application.

SPEnterpriseSearchQueryComponent

  • Get-SPEnterpriseSearchQueryComponent. Returns a query component.
  • New-SPEnterpriseSearchQueryComponent. Adds a query component to a query topology.
  • Remove-SPEnterpriseSearchQueryComponent. Deletes a query component.
  • Restart-SPEnterpriseSearchQueryComponent. Restarts a failed query component.
  • Set-SPEnterpriseSearchQueryComponent. Modifies properties for a query component.

SPEnterpriseSearchQueryDemoted

  • Get-SPEnterpriseSearchQueryDemoted. Returns a demoted site rule.
  • New-SPEnterpriseSearchQueryDemoted. Adds a demoted site rule to a shared search application.
  • Remove-SPEnterpriseSearchQueryDemoted. Deletes a demoted site rule.

SPEnterpriseSearchQueryKeyword

  • Get-SPEnterpriseSearchQueryKeyword. Returns a keyword term.
  • New-SPEnterpriseSearchQueryKeyword. Adds a keyword term to a shared search application.
  • Remove-SPEnterpriseSearchQueryKeyword. Deletes a query keyword.
  • Set-SPEnterpriseSearchQueryKeyword. Sets the properties of a keyword term for a shared search application.

SPEnterpriseSearchQueryScope

  • Get-SPEnterpriseSearchQueryScope. Returns a query results scope.
  • New-SPEnterpriseSearchQueryScope. Adds a query results scope to a shared search application.
  • Remove-SPEnterpriseSearchQueryScope. Deletes a query scope.
  • Set-SPEnterpriseSearchQueryScope. Sets the properties of a query results scope for a shared search application.

SPEnterpriseSearchQueryScopeRule

  • Get-SPEnterpriseSearchQueryScopeRule. Returns a shared scope rule.
  • New-SPEnterpriseSearchQueryScopeRule. Adds a shared scope rule to a query scope.
  • Remove-SPEnterpriseSearchQueryScopeRule. Deletes query results scope rules.
  • Set-SPEnterpriseSearchQueryScopeRule. Sets the properties of a shared scope rule for a query scope.

SPEnterpriseSearchQuerySuggestionCandidates

  • Get-SPEnterpriseSearchQuerySuggestionCandidates. Displays a list of queries.

SPEnterpriseSearchQueryTopology

  • Get-SPEnterpriseSearchQueryTopology. Returns a query topology.
  • New-SPEnterpriseSearchQueryTopology. Adds a query topology to a shared search application.
  • Remove-SPEnterpriseSearchQueryTopology. Deletes a query topology.
  • Set-SPEnterpriseSearchQueryTopology. Sets the properties of a query topology for a shared search application.

SPEnterpriseSearchRankingModel

  • Get-SPEnterpriseSearchRankingModel. Returns a ranking model.
  • New-SPEnterpriseSearchRankingModel. Adds a ranking model to a shared search application.
  • Remove-SPEnterpriseSearchRankingModel. Deletes a ranking model.
  • Set-SPEnterpriseSearchRankingModel. Sets the properties of a ranking model for a shared search application.

SPEnterpriseSearchSecurityTrimmer

  • Get-SPEnterpriseSearchSecurityTrimmer. Returns a custom security trimmer.
  • New-SPEnterpriseSearchSecurityTrimmer. Adds a custom security trimmer to a shared search application.
  • Remove-SPEnterpriseSearchSecurityTrimmer. Deletes a custom security trimmer.

Service Application

SPEnterpriseSearchService

  • Get-SPEnterpriseSearchService. Returns the search service for the farm.
  • Set-SPEnterpriseSearchService. Sets the properties of a search service for a farm.

SPEnterpriseSearchServiceApplication

  • Get-SPEnterpriseSearchServiceApplication. Returns the search service application for a farm.
  • New-SPEnterpriseSearchServiceApplication. Adds a search service application to a farm.
  • Remove-SPEnterpriseSearchServiceApplication. Deletes a search service application.
  • Restore-SPEnterpriseSearchServiceApplication. Restores third-party backup of a search application.
  • Set-SPEnterpriseSearchServiceApplication. Sets the properties of a search service application for a farm.
  • Upgrade-SPEnterpriseSearchServiceApplication. Upgrades a search service application.

SPEnterpriseSearchServiceApplicationProxy

  • Get-SPEnterpriseSearchServiceApplicationProxy. Returns the search service application proxy.
  • New-SPEnterpriseSearchServiceApplicationProxy. Adds a site hit rule for a search application.
  • Remove-SPEnterpriseSearchServiceApplicationProxy. Deletes a search service application proxy.
  • Set-SPEnterpriseSearchServiceApplicationProxy. Sets properties of a search service application proxy.

SPEnterpriseSearchServiceInstance

  • Get-SPEnterpriseSearchServiceInstance. Returns the search service instance for a farm.
  • Set-SPEnterpriseSearchServiceInstance. Sets the properties of a search service instance.
  • Start-SPEnterpriseSearchServiceInstance. Starts an instance of a search service.
  • Stop-SPEnterpriseSearchServiceInstance. Stops an instance of a search service.

Topology

SPEnterpriseSearchTopology

  • Export-SPEnterpriseSearchTopology. Saves an existing search topology.
  • Import-SPEnterpriseSearchTopology. Imports and activates a topology from an XML file.