Share via


SharePoint 2010 – get Search configuration over Powershell

Hello,

today it’s time to play a bit with Powershell and focus on the SharePoint Search.

First of all, i want  to show you the whole world of cmdlets in SharePoint 2010. Therefore i was interested to count all Cmdlets which comes from SharePoint 2010, means these commands are included in the namespace Microsoft.SharePoint.Powershell:

get-command | where {$_.ModuleName –eq “Microsoft.SharePoint.Powershell”} | measure

image

As you can see, at the moment we have in the public beta (build 12.0.4514) 535 cmdlets. I think the count of cmdlets will increase and not decrease in future. So it’s necessary to get a good entry point into SharePoint Powershell world.

Lets get all command which include the name “search”:

get-command *search* | where {$_.CommandType –eq “Cmdlet”} | measure

image

The result show us 131 cmdlets which only include the word “search". WOW

What’s about:

“index”
image

“query”:
image

 

“searchservice”:image

And as you know each cmdLet gives you and large list of members. E.g. get all member of the SharePoint Search Service Application:

get-SPEnterpriseSearchServiceApplication | get-member

image

An Example of a small list of display member:
image

Now lets go a bit into the deep:

List all Search Services on the farm:

Get-SPEnterpriseSearchService
image

List all Search Service Applications on the farm:

Get-SPEnterpriseSearchServiceApplicationimage

These commands are your entry point to get in contact with your Search Settings. Some Commands need the “Id” of the Search Service Application or Search Service Instance to get deeper settings.

Managing Search Topology

These nouns are available to manage the search topology in SharePoint 2010:

nouns cmdlets nouns starts with SPEnterpriseSeach*
Search Service Application SPEnterpriseSearchServiceApplication e.g. Get-SPEnterpriseSearchServiceApplication, Set-SPEnterpriseSearchServiceApplication
Search Service Instance SPEnterpriseSearchServiceInstance e.g. GET-SPEnterpriseSearchServiceInstance
Search Administration Component SPEnterpriseSearchAdministrationComponent
Search Property Database SPEnterpriseSearchPropertyDatabase e.g. GET-SPEnterpriseSearchPropertyDatabase
Search Query Topology SPEnterpriseSearchQueryTopology GET-SPEnterpriseSearchQueryTopology
Search Query Component SPEnterpriseSearchQueryComponent e.g. GET-SPEnterpriseSearchQueryComponent
Search Index Partition SPEnterpriseSearchIndexPartition e.g. Get-SPEnterpriseSearchIndexPartition
Search Crawl Database SPEnterpriseSearchCrawlDatabase e.g. GET-SPEnterpriseSearchCrawlDatabase
Search Crawl Topology SPEnterpriseSearchCrawlTopology e.g. GET-SPEnterpriseSearchCrawlTopology
Search Crawl Component SPEnterpriseSearchCrawlComponent e.g. GET-SPEnterpriseSearchCrawlComponent

Notice: The naming convention for Powershell include verbs and nouns in a structure like this: [VERB] - [NOUN]

In Sharepoint 2010 we have verbs like: GET, SET, REMOVE, INSTALL, UNINSTALL, NEW, ENABLE, DISABLE. ADD, START, STOP, MOVE, BACKUP, Export,Import, …

So the table of search nouns i collect for you displays only a small subset of commands (e.g. the most known GET). For you it’s more important to have a look at the nouns to get a fast entry point..

Now lets play with these commands in detail:

  • combine SearchServiceApplication with SearchAdministrationComponent to get for each SearchServiceApplication the SearchAdministrationComponent information:

“GET-SPEnterpriseSearchServiceApplication | Get-SPEnterpriseSearchAdministrationComponent”
image 

  • combine SearchPropertyDatabase with SearchServiceApplication to get for each SearchServiceApplication the SearchPropertyDatabase information:

“GET-SPEnterpriseSearchServiceApplication | Get-SPEnterpriseSearchPropertyDatabase

image

  • combine SearchServiceApplication  with SearchQueryTopology:

“GET-SPEnterpriseSearchServiceApplication | GET-SPEnterpriseSearchQueryTopology “

image

  • combine SearchServiceApplication  with the SearchQueryTopology and SearchQueryComponent:

“GET-SPEnterpriseSearchServiceApplication | GET-SPEnterpriseSearchQueryTopology | GET-SPEnterpriseSearchQueryComponent“

image

  • combine SearchServiceApplication  with the SearchQueryTopology and SPEnterpriseSearchIndexPartition

“GET-SPEnterpriseSearchServiceApplication | GET-SPEnterpriseSearchQueryTopology | SPEnterpriseSearchIndexPartition“

image

  • combine SearchServiceApplication  with the SPEnterpriseSearchCrawlDatabase

“GET-SPEnterpriseSearchServiceApplication | GET-SPEnterpriseSearchCrawlDatabase

image

  • combine SearchServiceApplication with SearchCrawlTopology:

“GET-SPEnterpriseSearchServiceApplication | GET-SPEnterpriseSearchCrawlTopology

image

  • combine SearchServiceApplication with SearchCrawlTopology and SearchCrawlComponent:

“GET-SPEnterpriseSearchServiceApplication | GET-SPEnterpriseSearchCrawlTopology | GET-SPEnterpriseSearchCrawlComponent

image

And at the end of the post we get a in touch with 10 search cmdlets of 535 SharePoint cmdlets, so only 525 left. ;-)

Regards

Patrick

Comments

  • Anonymous
    January 22, 2017
    nice - how do I create and provision a search application?