In this article we will be seeing how to create Scopes in a SharePoint 2010
Enterprise Search Service Application using PowerShell.
Automating the Scopes creation in SharePoint 2010
We can create Scopes in a SharePoint 2010 Enterprise Search Service Application
from Central Administration.
Go to Central Administration => Application Management => Manage Service
Applications => Enterprise Search Service Application.

On the Quick Launch Menu, go to Queries and Results then click on Scopes.

You should be able to see the Scopes. By clicking on New Scope link we can create
a new Scope.
Another way is we can create the
Search Scopes
in SharePoint 2010 using SharePoint Object Model.
Here we will be seeing about automating the Scopes creation using a powershell
script.
Steps Involved:
- Create the input XML file which contains the inputs for Scope creation.
- Create ps1 file which contains the script for scope creation.
CreateScopes.xml
<?xml
version="1.0"
encoding="utf-8"
?>
<Scopes>
<SSAName>EnterPrise
Search Service Application</SSAName>
<Scope
Name="Sample1"
Description="Sample1
Scope" />
<Scope
Name="Sample2"
Description="Sample2
Scope" />
<Scope
Name="Sample3"
Description="Sample3
Scope" />
</Scopes>
CreateScopes.ps1
#----------------Get
the xml file---------------------------------------------------------------
[xml]$xmlData=Get-Content "C:\Users\Desktop\ContentSources\CreateScopes.xml"
#----------------Create New Scope function---------------------------------------------



Join the conversation! Your thoughts help the community grow.