Create Enterprise Search Center in SharePoint using PowerShell

What is sharepoint Search Center in SharePoint?
Search Center site in SharePoint provides an interface for users to submit search queries and get search results similar to any other search engine. A Search Center site is typically a top-level site of a site collection that provides central search facility.

How to Create Search Center Site Collection?
Creating search center is quite straight forward. Key it: Select Search Center template while creating site collection / subsite to create search center in sharepoint 2013. You can create a search center either with Enterprise Search Center template or Basic Search Center template.

Basic Search Center vs Enterprise Search Center:
The difference between Enterprise Search Center template and the Basic Search Center template is the ability to customize user experience. In an Enterprise Search Center, you can create your own site pages; whereas, in a Basic Search Center, Search results are displayed on a system page where we cannot customize. You can only edit the search and search result pages that the template delivers.

Prior creating an Enterprise Search Center, you must enable the SharePoint Server Standard Site Collection and the SharePoint Server Standard Publishing infrastructure features. Creating Search center site involves these three steps:
  1. Create a new web application (optional, but preferred)
  2. Create a Search Center site collection.
Open the SharePoint 2016 Central Administration site >> Application Management >> Create new web application and top level site collection with enterprise search center template.
sharepoint 2013 how to create search center
SharePoint 2013: create enterprise search center using PowerShell:
This PowerShell script creates new web application and enterprise search center site collection.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Define Variables for Web Application Creation
$WebAppName = "Crescent Search Center"
$HostHeader = ""
$WebAppURL = "http://" + $HostHeader
$WebAppPort = "80"
$ContentDBName = "Crescent_Search_Content"
$AppPoolName = "Crescent Search Web Application App Pool"
$AppPoolAccount = "Crescent\SP16_Pool"
$FarmAdminAccount = "Crescent\SP16_Farm"

#Authentication Provider
$AuthProvider = New-SPAuthenticationProvider

#Check if Managed account is registered already
Write-Host -ForegroundColor Yellow "Checking if the Managed Accounts already exists"
$AppPoolAccount = Get-SPManagedAccount -Identity $AppPoolAccount -ErrorAction SilentlyContinue
if ($AppPoolAccount -eq $null)
    Write-Host "Please Enter the password for the Service Account..."
    $AppPoolCredentials = Get-Credential $AppPoolAccount
    $AppPoolAccount = New-SPManagedAccount -Credential $AppPoolCredentials

#Create new Web Application
New-SPWebApplication -name $WebAppName -port $WebAppPort -hostheader $HostHeader -URL $WebAppURL -ApplicationPool $AppPoolName -ApplicationPoolAccount (Get-SPManagedAccount $AppPoolAccount) -AuthenticationMethod NTLM -AuthenticationProvider $AuthProvider -DatabaseName $ContentDBName

#Create Enterprise Search Center site collection
New-SPSite -Name $WebAppName -Url $WebAppURL -Template "SRCHCEN#0" -OwnerAlias $FarmAdminAccount -ContentDatabase $ContentDBName

Next step: Configure search center permissions
Once search center site is created, you must grant permission to all users in the organization in order for them to access search center site. 
  • Go to : Site Settings >> Site Permissions >> Enterprise Search Visitors Group >> Add "Everyone"

Tags: create a search center sharepoint 2013, sharepoint 2013 create search center powershell, sharepoint powershell create enterprise search center, sharepoint 2013 create enterprise search center powershell

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.