Sei sulla pagina 1di 19

Singapore,

2015

PowerShell in SharePoint
2013 - a Powerful
Management Tool
Gayathri Narayanan, Lead Consultant, NCS Pte Ltd
Platinum
Sponsors

Singapore, 2015
2015

PowerShell and SharePoint 2013


High level overview of PowerShell
Permissions and PowerShell

Understanding SharePoint Search Service Application


PowerShells Search Service Application (SSA)
Creating and Modifying the Search topology

Content Management
Managing content databases
Managing database site collections

Memory and Disposal

Agenda

Singapore, 2015
2015

PowerShell and SharePoint 2013

Singapore, 2015
2015

High level overview of PowerShell

Interactive task-based command line shell for


Microsoft products (Windows, SharePoint, SQL Server,
etc.)
Replaces deprecated STSADM SharePoint tool
Used to automate and schedule routine system tasks
Cmdlets are simple single-function command-line
commands
Name format is verb-noun separated by a dash: GetHelp
Cmdlet performs specific task Get retrieves object

Singapore, 2015
2015

Permissions and PowerShell

Open PowerShell as Administrator


If using Windows PowerShell Console, must register SharePoint
snap-in using Add-PSSnapin Microsoft.SharePoint.PowerShell
Account used to install SharePoint granted PowerShell Admin
rights. Use Add-SPShellAdmin to grant to other users
Requires securityadminfixed server roleon SQL Server Instance
Requires db_ownerfixed database roleon all databases updating
Requires you be a member of the Administrators group on server
running PowerShell commands

Singapore, 2015
2015

Understanding SharePoint SSA

Singapore, 2015
2015

SharePoint Search Architecture

Singapore, 2015
2015

Creating Search Service Application

Out of the box Vs PowerShell


Out of the
Box

PowerShell

A Clean Database
Name

No

Yes

Index Location

No

Yes

Modify Topology

No

Yes

Multiple Server SSA

No

Yes

Singapore, 2015
2015

PowerShells Search Service


Application

Expedites the creation of Search service application in


DR scenario
Allows you to specify components of Search service
Database Names
Application Pool
Proxy Server Name

Create script to reuse when building multiple instances


of a Search service application
Must use PowerShell to modify search topology

Singapore, 2015
2015

Search Topology

Singapore,
2015

Singapore,
2015

Singapore, 2015
2015

Managing Content Database

Singapore, 2015
2015

Content DB Cmdlets

Get-SPContentDatabase
New-SPContentDatabase -Name SharePoint_Content_DB
-WebApplication SharePoint Demo
Set-SPContentDatabase http://SharePointDemo.com |
-Set-SPContentDatabase -MaxSiteCount 1
Dismount-SPContentDatabase
Mount-SPContentDatabase
Remove-SPContentDatabase
Test-SPContentDatabase

Singapore, 2015
2015

Site Collection Cmdlets

Get-SPSite CBTN_Content_DB
Move-SPSite http://SharePointDemo.com/sites/demo
-DestinationDatabase SharePoint_Content_DB
New-SPSite http://SharePointDemo.com/sites/NewMVA
ContentDatabase SharePoint_Content_DB -Template
"STS#0"

Singapore,
2015

Singapore, 2015
2015

Memory and Disposal

SPSite and SPWeb consumes resources


PowerShell, in conjunction with the SharePoint object model, assists in the
disposal of expensive SharePoint objects.
Use SharePoint Management Shell, rather than the standard Windows
PowerShell which is a multi-threaded.
Get-SPWebApplication | Get-SPSite limit all | Foreach-Object { $._Url }
Windows PowerShell
Start-SPAssignment Global
$site = Get-SPSite "http://sp2013"
Foreach ($web in $site.AllWebs) {
Write-Host $web.Title
}
Stop-SPAssignment Global

Singapore, 2015
2015

PowerShell and SharePoint 2013

Summary

High level overview of PowerShell


Permissions and PowerShell

Understanding SharePoint Search Service Application


PowerShells Search Service Application (SSA)
Creating and Modifying the Search topology

Content Management
Managing content databases
Managing database site collections

Memory and Disposal

Singapore,
2015

Dont Forget!
Fill in your survey its how we do better!
Dont lose your badge! You need it for the Social Events
Grab the Speakers for a chat they all have time for you!
Let everyone know what they are missing on Social Media
#PowerShell
#PSConfAsia
Tweets (preferably with Pictures) win Prizes!!!!

Potrebbero piacerti anche