IT tutorials
 
Applications Server
 

Microsoft Sharepoint 2013 : Some Sample PowerShell Scripts (part 2) - Creating the Search Service Application in SharePoint 2013 Server

4/7/2015 4:44:08 AM
- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire

Creating the Search Service Application in SharePoint 2013 Server

While you can create your Search service application in Central Admin, doing so will create all your Search databases with GUIDs at the end. No one likes GUIDs. They were always picked last for kickball in grade school, every, single, time. If you instead create the Search service with PowerShell, you can specify the database names SharePoint should use. The following script will do that for you (note that it assumes that the service application pool from the previous section exists):



# Get App Pool
$saAppPoolName = "Default SharePoint Service App Pool"

# Search Specifics, we are single server farm
$searchServerName = (Get-ChildItem env:computername).value
$serviceAppName = "Search Service Application"
$searchDBName = "SearchService_DB"

# Grab the Appplication Pool for Service Application Endpoint
$saAppPool = Get-SPServiceApplicationPool $saAppPoolName

# Start Search Service Instances
Write-Host "Starting Search Service Instances..."
Start-SPEnterpriseSearchServiceInstance $searchServerName
Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance $searchServerName

# Create the Search Service Application and Proxy
Write-Host "Creating Search Service Application and Proxy..."
$searchServiceApp = New-SPEnterpriseSearchServiceApplication -Name $serviceAppName
-ApplicationPool $saAppPoolName -DatabaseName $searchDBName
$searchProxy = New-SPEnterpriseSearchServiceApplicationProxy -Name "$serviceAppName
Proxy" -SearchApplication $searchServiceApp

# Clone the default Topology (which is empty) and create a new one and then
activate it
Write-Host "Configuring Search Component Topology..."
$clone = $searchServiceApp.ActiveTopology.Clone()
$searchServiceInstance = Get-SPEnterpriseSearchServiceInstance
New-SPEnterpriseSearchAdminComponent –SearchTopology $clone –SearchServiceInstance
$searchServiceInstance
New-SPEnterpriseSearchContentProcessingComponent –SearchTopology $clone
-SearchServiceInstance $searchServiceInstance
New-SPEnterpriseSearchAnalyticsProcessingComponent –SearchTopology $clone
-SearchServiceInstance $searchServiceInstance
New-SPEnterpriseSearchCrawlComponent –SearchTopology $clone
-SearchServiceInstance $searchServiceInstance
New-SPEnterpriseSearchIndexComponent –SearchTopology $clone
-SearchServiceInstance $searchServiceInstance
New-SPEnterpriseSearchQueryProcessingComponent –SearchTopology $clone
-SearchServiceInstance $searchServiceInstance
$clone.Activate()

Write-Host "Search Done!"

After running this script, head over to Central Admin and enjoy the fruits of your labor.

Creating a Claims Web Application

following little beauty will create a new web application and use claims-based authentication:

$ap = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication 
-DisableKerberos

New-SPWebApplication -Name "Contoso Portal"
-ApplicationPool "Default SharePoint Web Apps"
-HostHeader portal.contoso.com -Port 80 -Url http://portal.contoso.com
-AuthenticationMethod NTLM -AuthenticationProvider $ap
-DatabaseName "WSS_Content_Portal"

Getting Site Collection Size

You can use this one-liner to list all the site collections in your farm, sorted by size:

Get-SPSite | select url, @{label="Size in MB";Expression={$_.usage.storage/1MB}} | 
Sort-Object -Descending -Property "Size in MB" | Format-Table –AutoSize
Getting Database Size

The following will list all the databases in your farm, sorted by size:

Get-SPDatabase | select name, @{label="Size in MB";Expression=
{$_.disksizerequired/1MB}} | Sort-Object -Descending -Property "Size in MB"

Hopefully you’ll be able to grab some useful nuggets from these scripts and write some amazing scripts of your own.

 
Others
 
- Microsoft Sharepoint 2013 : Some Sample PowerShell Scripts (part 1) - Creating Your SharePoint 2013 Farm with PowerShell, Creating Managed Accounts and Service Application Pools
- VMware View 5 Architecture : Virtual (part 4) - Network, Storage
- VMware View 5 Architecture : Virtual (part 3) - vCenter Server
- VMware View 5 Architecture : Virtual (part 2) - VMware vSphere 5 Architecture, VMware vSphere 5, VMware ESXi, VMware vSphere 5
- VMware View 5 Architecture : Virtual (part 1) - Infrastructure Introduction
- VMware View 5 : Establishing a Performance Baseline (part 10)
- VMware View 5 : Establishing a Performance Baseline (part 9)
- VMware View 5 : Establishing a Performance Baseline (part 8)
- VMware View 5 : Establishing a Performance Baseline (part 7)
- VMware View 5 : Establishing a Performance Baseline (part 6)
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
programming4us programming4us
 
Popular tags
 
Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS