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
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

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
 
 
Facebook
 
Technology FAQ
- Microsoft ebs security server configuration
- IIs7 on Windows server 2003
- How to Configure Failover Clusters With Win 2008 Server R2?
- Windows 2008 Network Load Balancing
- Windows Server 2008 - Group Policy Management - Remove Computer Management
- Remove shortcuts possibility in a web page or to put in favorite
- HTA Dynamic Drop Down List
- IIS host header and DNS
- VMware or MS Virtual Server?
- Adobe Acrobat 9 inserting tab pages
programming4us programming4us