Top Banner
Automating SharePoint 2010 administration tasks with Power Shell Toni Frankola SharePoint MVP, Croatia [email protected] http://sharepointusecases.com @ToniFrankola
31

Automating SharePoint 2010 administration tasks with PowerShell

Apr 22, 2015

Download

Technology

Toni Frankola

 
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Automating SharePoint 2010 administration tasks with PowerShell

Automating SharePoint 2010 administration tasks with Power Shell

Toni FrankolaSharePoint MVP, [email protected]://sharepointusecases.com @ToniFrankola

Page 3: Automating SharePoint 2010 administration tasks with PowerShell

Contents

Why automation?

Automation via

PowerShellHello world

Basic SharePoint

PS

Advanced PS Magic and

scripts

Page 4: Automating SharePoint 2010 administration tasks with PowerShell

The problem

• A SharePoint farm:

Page 5: Automating SharePoint 2010 administration tasks with PowerShell

The problem (2) – SharePoint structure

• Farm• Web Applications– Site Collections– Sites– Lists– ...

• Service Applications– Search– User profile– ...

Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings

Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings, Setings

Page 6: Automating SharePoint 2010 administration tasks with PowerShell

In 2007

• Stsadm

• Automation

Page 7: Automating SharePoint 2010 administration tasks with PowerShell

stsadm

• Limited–Not that many cmdlets available– Script language• extending?

– Gary Lapointe– Codeplex

• Some tasks only via stsadm• Only for SharePoint (SQL? AD?)

Page 8: Automating SharePoint 2010 administration tasks with PowerShell

Enters PowerShell

• New automation language• Mixture of script and .NET• 600+ cmdlets for SharePoint alone• Target audience? DEV / IT Pro?• Not limited to SharePoint– AD– SQL– IIS– Exchange, Lync…

Page 9: Automating SharePoint 2010 administration tasks with PowerShell

Why PowerShell?

• Saves time & money– Repeatable tasks• E.g. Deploying SharePoint for customers

– Eliminates mistakes (loopback check, PDF iFilter)

• Tasks with no GUI– E.g. multi-tenant administration

• Go beyond original programming–User profiles magic

Page 10: Automating SharePoint 2010 administration tasks with PowerShell

Basic cmdlets

• Get-Command• Get-Help Get-SPSite• Write-Host „Hello World!”

Page 11: Automating SharePoint 2010 administration tasks with PowerShell

Pipeline

Get-SPSite | Get-SPWeb

| Get-SPList*

* Get-SPList is a custom function

Page 12: Automating SharePoint 2010 administration tasks with PowerShell

BASIC SHAREPOINT MAGIC

DEMO

Page 13: Automating SharePoint 2010 administration tasks with PowerShell

The tools

• SharePoint 2010 Management Shell– PS & stsadm & SP stuff

• PS Script Editor• Quest PowerGUI– THE tool• Debugging, Formatting,

Intellisense

– FREE– Download now!

!!!

Page 14: Automating SharePoint 2010 administration tasks with PowerShell

Output

Output

Screen

Grid

CSV

HTML

XML

.NET

Page 15: Automating SharePoint 2010 administration tasks with PowerShell

PS: HELLO WORLD, POWERGUI, OUTPUT, FUNCTIONS

DEMO

Page 16: Automating SharePoint 2010 administration tasks with PowerShell

Use case: SP Installation

• Produces a „clean”, controllable install

• Repeatable• Ideal for Testing, QA, Dev

Page 17: Automating SharePoint 2010 administration tasks with PowerShell

Use case: SP Installation (2)

• „Simple” scripts– SP 2010 Unleashed install

http://tinyurl.com/SPFarm-Config– Installs farm and most service apps

• Advanced: AutoSPInstaller– Completly automated– Installs SP and farm

Page 18: Automating SharePoint 2010 administration tasks with PowerShell

FARM INSTALLATIONDEMO

Page 19: Automating SharePoint 2010 administration tasks with PowerShell

Eliminate repetetive tasks

• How many times have you done this?– Disabled loopback check?– Configured PDF: Icon, iFilter, Crawl

• How many times you made mistakes• Solution:

Automate PDF configuration for SharePoint 2010 via PowerShell– Check autoSPinstall for more details

Page 20: Automating SharePoint 2010 administration tasks with PowerShell

CONFIGURING PDF STUFF

DEMO

Page 22: Automating SharePoint 2010 administration tasks with PowerShell

MULTILINGUAL SITESDEMO

Page 23: Automating SharePoint 2010 administration tasks with PowerShell

SOLUTION INSTALLATIONSITE WARM-UP

Demo

Page 24: Automating SharePoint 2010 administration tasks with PowerShell

Use profiles story

• OOTB: Cannot map all the properties (binary, manager)

• PowerShell–More flexible– Automate via scheduled tasks

User Profile

SA

File Share (pics)

HR LOB (propertie

s)

SharePoint

Page 25: Automating SharePoint 2010 administration tasks with PowerShell

USER PROFILESDemo

Page 26: Automating SharePoint 2010 administration tasks with PowerShell

Automate site provisioning

• Much easier to control• Automate completly• Configure additional properties

(theme?, template,....)

Portal

A B C

C1 C2 C3

C31 C32

C321 C322

C3221

C33

D

Page 27: Automating SharePoint 2010 administration tasks with PowerShell

SITE PROVISIONINGDEMO

Page 28: Automating SharePoint 2010 administration tasks with PowerShell

Extending PowerShell

• This is .NET• Easy to extend with OOTB

SharePoint API• Use case:– Configure versioning settings

for all lists

SPFarm

SPWebApplication

SPSite

SPWeb

???

Page 29: Automating SharePoint 2010 administration tasks with PowerShell

BEYOND ORIGINAL PROGRAMMINGLIST VERSIONING

DEMO

Page 30: Automating SharePoint 2010 administration tasks with PowerShell

Questions

Please fill out the survey!

Page 31: Automating SharePoint 2010 administration tasks with PowerShell

THANK YOU FOR ATTENDING

Thanks to our sponsors:

ENJOY THE SHAREPOINT DAY!