automating sharepoint 2010 administration tasks with powershell

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

Upload: toni-frankola

Post on 22-Apr-2015

8.801 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Automating SharePoint 2010 administration tasks with Power Shell

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

Contents

Why automation?

Automation via

PowerShellHello world

Basic SharePoint

PS

Advanced PS Magic and

scripts

The problem

• A SharePoint farm:

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

In 2007

• Stsadm

• Automation

stsadm

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

– Gary Lapointe– Codeplex

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

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…

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

Basic cmdlets

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

Pipeline

Get-SPSite | Get-SPWeb

| Get-SPList*

* Get-SPList is a custom function

BASIC SHAREPOINT MAGIC

DEMO

The tools

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

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

Intellisense

– FREE– Download now!

!!!

Output

Output

Screen

Grid

CSV

HTML

XML

.NET

PS: HELLO WORLD, POWERGUI, OUTPUT, FUNCTIONS

DEMO

Use case: SP Installation

• Produces a „clean”, controllable install

• Repeatable• Ideal for Testing, QA, Dev

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

FARM INSTALLATIONDEMO

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

CONFIGURING PDF STUFF

DEMO

MULTILINGUAL SITESDEMO

SOLUTION INSTALLATIONSITE WARM-UP

Demo

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

USER PROFILESDemo

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

SITE PROVISIONINGDEMO

Extending PowerShell

• This is .NET• Easy to extend with OOTB

SharePoint API• Use case:– Configure versioning settings

for all lists

SPFarm

SPWebApplication

SPSite

SPWeb

???

BEYOND ORIGINAL PROGRAMMINGLIST VERSIONING

DEMO

Questions

Please fill out the survey!

THANK YOU FOR ATTENDING

Thanks to our sponsors:

ENJOY THE SHAREPOINT DAY!