Automating SharePoint 2010 administration tasks with Power Shell Toni Frankola SharePoint MVP, Croatia [email protected] http://sharepointusecases.com @ToniFrankola
Automating SharePoint 2010 administration tasks with Power Shell
Toni FrankolaSharePoint MVP, [email protected]://sharepointusecases.com @ToniFrankola
Materials
• Book
• Blog:– http://www.sharepointusecases.com
Contents
Why automation?
Automation via
PowerShellHello world
Basic SharePoint
PS
Advanced PS Magic and
scripts
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
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
The tools
• SharePoint 2010 Management Shell– PS & stsadm & SP stuff
• PS Script Editor• Quest PowerGUI– THE tool• Debugging, Formatting,
Intellisense
– FREE– Download now!
!!!
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
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
Use case: Hej SharePoint!
• Apply language settings to all sites in a site collection
DK
DK
DK SE
SE
SE
EN
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
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
Extending PowerShell
• This is .NET• Easy to extend with OOTB
SharePoint API• Use case:– Configure versioning settings
for all lists
SPFarm
SPWebApplication
SPSite
SPWeb
???