4. Singapore, 2015Singapore, 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: Get-Help
• Cmdlet performs specific task – Get retrieves object data, Set
changes object data, Out directs output to specific destination
5. Singapore, 2015Singapore, 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 securityadmin fixed server role on SQL Server Instance
• Requires db_owner fixed database role on all databases
updating
• Requires you be a member of the Administrators group on
server running PowerShell commands
8. Singapore, 2015Singapore, 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
9. Singapore, 2015Singapore, 2015
PowerShell’s 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
17. Singapore, 2015Singapore, 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
18. Singapore, 2015Singapore, 2015
Summary
• PowerShell and SharePoint 2013
• High level overview of PowerShell
• Permissions and PowerShell
• Understanding SharePoint Search Service Application
• PowerShell’s Search Service Application (SSA)
• Creating and Modifying the Search topology
• Content Management
• Managing content databases
• Managing database site collections
• Memory and Disposal
Notas del editor
Now, really, up until now, we've...
we... we've seen some of the... some of the management parts
for certain, but we've actually focused a lot on the creating.
You know, create that... that... that...Service app Create search. Now, we want to turn our attention a bit more towards that management part that... you know, it'd be nice if we could start to, you know, manage where our data's going to wind up with different content databases and things like that. And... and something tells me, since it's part of this MVA course, that this can really only effectively be done by using PowerShell.
We can only do an import using PowerShell, so.Okay. All right. How about databases?
Databases, we could work with... we can create databases in central admin. We can create Database in PowerShell. Okay. All right. Well...
Moving site collections we cannot do that in both places
That's... that's a PowerShell command.
Well, how about we start digging into it? Why don't you show
us some of the different PowerShell CMDlets that... that are available to us.