automating your enterprise application deployments with powershell by geoff varosky - sptechcon

39
Automating your Enterprise Application Deployments with PowerShell Geoff Varosky March 5, 2013

Upload: sptechcon

Post on 13-Nov-2014

1.566 views

Category:

Documents


4 download

DESCRIPTION

Technical Class: Tuesday, March 5 4:00 PM - 5:15 PM

TRANSCRIPT

Page 1: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

Automating your Enterprise Application Deployments with PowerShell

Geoff VaroskyMarch 5, 2013

Page 2: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

ABOUT ME

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Geoff Varosky Jornata

Managing Consultant, Senior Architect, Senior Developer, Director of Evangelism

President & Co-Founder Boston Area SharePoint Users Group Co-Organizer SharePoint Saturday Boston

Recent Awards Top 25 2012 Harmon.ie Online Community Influencer Top 50 2012 KnowledgeLake Community Influencer

Blog – www.SharePointYankee.com Email – [email protected] Twitter – @gvaro

Page 3: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

ABOUT ME

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 4: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

AGENDA

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Why Automation? PowerShell Environment Deployment Application Deployment Further Refinement Resources & Tools Q&A

Page 5: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

POLL

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Who is using SharePoint? SharePoint Developers? SharePoint Administrators? Familiar with Scripting Languages? (bash, batch files, perl,

vbscript) Using PowerShell?

Page 6: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

WHY AUTOMATION?

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 7: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

WHY AUTOMATION? Pros

“Almost” human-less deployments Re-Deployment Restoration Documented and actionable deployment Saves on knowledge transfer Reduces the risks of human error Repeatable process

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 8: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

WHY AUTOMATION? Cons

Possible significant up-front time Knowledge of PowerShell needed Not managed code Requires constant upkeep

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 9: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

POWERSHELL

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 10: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

POWERSHELL What is it?

More flexible, faster, extensible, and POWERful than STSADM

Scripting Language Based on C# Integrated with the .NET Framework

Load in DLLs Provides full access to COM amd WMI

Not limited to JUST PowerShell DOS commands (with UNIX-like aliases)

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 11: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

POWERSHELL Cmdlets

PowerShell Commands Can create your own Standardized using a verb-noun convention

Eat-Cake Drink-Beer Live-Life

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 12: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

POWERSHELL The Basics

Get-Command Get-Help Piping Select-Object

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 13: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

POWERSHELL Aliases

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Cmdlet DOS Alias Description

Get-Location pwd gl Current directory

Set-Location cd, chdir sl Change current directory

Copy-Item copy cpi Copy file/directory

Remove-Item del ri Remove file/directory

Move-Item move mi Move a file/directory

New-Item - ni New a file/directory/object

Clear-Item - cli Clear contents of file

Get-Content type gc Read file contents to output

Set-Content - sc Set file contents

Format-Table - ft Formats output

Page 14: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

POWERSHELL SharePoint Management Shell

Loaded with SharePoint 2010/2013 Automatically Loads Microsoft.SharePoint.PowerShell

Snap In 531 cmdlets

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 15: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

POWERSHELL SharePoint Management Shell

Requires PowerShell 2.0 Backwards compatible, installs into 1.0 folder

<%SystemRoot%>\System32\WindowsPowerShell\v1.0\PowerShell.exe

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 16: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

DEMO: SHAREPOINT CMDLETS

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 17: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

ENVIRONMENT DEPLOYMENT

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 18: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

ENVIRONMENT DEPLOYMENT AutoSPInstaller

Deploy single or multi-server farms from one script XML-based configuration Re-launches with Elevated Privs to deal with User Access

Control Automatically download and install platform pre-

requisites Can be done in offline mode

Install both SharePoint and Office Web Apps using config files

ULS Logging path IIS Configuration PDF iFilter [email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 19: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

ENVIRONMENT DEPLOYMENT AutoSPInstaller

Remote installation into other servers into the farm Forefront installation and configuration Logging of all installation Easily re-start if a failure occurs Easily slipstream installations (service pack 1, CUs, etc.) Create web applications, site collections New WFE or App Server? Wash, Rinse, Repeat. New web application or service application? Wash, Rinse,

Repeat.

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 20: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

ENVIRONMENT DEPLOYMENT Configure Service Applications

User Profile Service Application User Profile Synchronization Service Metadata Service Application SharePoint Foundation User Code Service State Service Application Usage and Health Service Application Secure Store Service Enterprise Search Service Application Web Analytics Service Application Business Data Connectivity Service Application Excel Service Application Access Service Application

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 21: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

ENVIRONMENT DEPLOYMENT Configure Service Applications

PerformancePoint Service Application Visio Graphics Service Application Word Automation (Conversion) Service Application Word Viewing Service Application Excel Service Application (if not already provisioned by virtue of having an

Enterprise license)

Not PowerPivot Overly complex install

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 22: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

ENVIRONMENT DEPLOYMENT Creates databases based on YOUR naming

conventions

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 23: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

ENVIRONMENT DEPLOYMENT Maintenance

Any configurable change needs to be updated If versioned, provides an evolution of your farm Ensures

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 24: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

DEMO: AUTOSPINSTALLER REVIEW

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 25: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

APPLICATION DEPLOYMENT

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 26: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

APPLICATION DEPLOYMENT Why deploy applications in PowerShell?

Developers can pass installations to administrators Replicable through environment deployments

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

DEV TEST PROD

Page 27: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

APPLICATION DEPLOYMENT What can be automated?

Farm Configuration Service application configuration

Search scopes Managed Metadata

Web application configuration Upload limits Permission policies

Solution Deployment EXE and MSI deployments

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 28: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

APPLICATION DEPLOYMENT Anatomy

Deployment Master Script Variables Initiates Logging Step-By-Step Deployment Directions and Documentation

Shared Functions File Updates not to be done across scripts Managed by platform team

Steps

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 29: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

DEMO: APPLICATION DEPLOYMENT

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 30: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

RECOMMENDATIONS Documentation

Provide overall Guidelines Basic usage, functionality Naming of scripts How scripts are used How to use basic functions How to run steps

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 31: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

RECOMMENDATIONS Documentation

Function Reference Copy of Functions script

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 32: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

RECOMMENDATIONS Documentation

Script Samples Helps with buy-in Gives examples Re-usable snippets

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 33: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

FURTHER REFINEMENTS… Handle all configuration via XML file variables Export steps to their own scripts Manage entirely through SharePoint Lists

Additional steps can be scripted/approved through workflow? Host documentation and example scripts in SharePoint,

allow alerts for file changes

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 34: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

RESOURCES What is COM?

http://en.wikipedia.org/wiki/Component_Object_Model What is WMI?

http://en.wikipedia.org/wiki/Windows_Management_Instrumentation PowerShell for SharePoint References

2010: http://go.gvaro.net/XgmYCk 2013: http://go.gvaro.net/YBLtGW

Cmdlet Index 2010: http://go.gvaro.net/WHh5wD 2013: http://go.gvaro.net/151DGaX

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 35: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

TOOLS Windows PowerShell for SharePoint Command

Builder http://go.gvaro.net/WS4s3u

Gary Lapointe’s PowerShell cmdlets http://go.gvaro.net/YirJau

AutoSPInstaller http://autospinstaller.codeplex.com

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 36: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

QUESTIONS?

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 37: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

BOSTON AREA SPUG Meets 2nd Wednesday/month 6-8PM Microsoft N.E.R.D. (Cambridge) BostonSharePointUG.org Twitter: @BASPUG / #BASPUG SPTechCon Hosted Meeting in August!

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 38: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

QUESTIONS?

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Page 39: Automating Your Enterprise Application Deployments With PowerShell by Geoff Varosky - SPTechCon

ABOUT ME

[email protected] | @gvaro | www.sharepointyankee.com | www.jornata.com | @JornataLLC

Geoff Varosky Jornata

Managing Consultant, Senior Architect, Senior Developer, Director of Evangelism

President & Co-Founder Boston Area SharePoint Users Group Co-Organizer SharePoint Saturday Boston

Recent Awards Top 25 2012 Harmon.ie Online Community Influencer Top 50 2012 KnowledgeLake Community Influencer

Blog – www.SharePointYankee.com Email – [email protected] Twitter – @gvaro