Automating SharePoint 2010 administration tasks with Power Shell Toni Frankola SharePoint MVP, Croatia
Materials Book Blog: –
Contents Why automation? Automation via PowerShell Hello 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
In 2007 Stsadm Automation
stsadm Limited – Not that many cmdlets available – Script language extending? – Gary Lapointe 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! Download now! !!!
Output ScreenGridCSVHTMLXML.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 – Installs farm and most service apps Advanced: AutoSPInstallerAutoSPInstaller – Completly automated – Installs SP and farm
FARM INSTALLATION DEMO
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 PowerShellAutomate PDF configuration for SharePoint 2010 via PowerShell – Check autoSPinstall for more details
CONFIGURING PDF STUFF DEMO
Use case: Hej SharePoint! Apply language settings to all sites in a site collection Apply language settings to all sites in a site collection DK SE EN
MULTILINGUAL SITES DEMO
SOLUTION INSTALLATION SITE 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 (properties) SharePoint
USER PROFILES Demo
Automate site provisioning Much easier to control Automate completly Configure additional properties (theme?, template,....) PortalABCC1C2C3C31C32C321C322C3221C33D
SITE PROVISIONING DEMO
Extending PowerShell This is.NET Easy to extend with OOTB SharePoint API Use case: – Configure versioning settings for all lists SPFarm SPWebApplicationSPSiteSPWeb???
BEYOND ORIGINAL PROGRAMMING LIST VERSIONING DEMO
Questions Please fill out the survey!
THANK YOU FOR ATTENDING Thanks to our sponsors: ENJOY THE SHAREPOINT DAY!