SlideShare a Scribd company logo
1 of 29
MAKING LIFE EASIER
WITH POWERSHELL




    January 7, 2012
AGENDA

           •   What is PowerShell
           •   Working with PowerShell
           •   When to Use PowerShell
           •   Top 10 SharePoint 2010 Cmdlets
           •   Using the PowerShell Pipeline
           •   User Scenarios
           •   Tools & Resources




1/7/2012                  Making Life Easier with PowerShell   3
Core Concepts

           WHAT IS POWERSHELL


1/7/2012                   Making Life Easier with PowerShell   4
WHAT IS POWERSHELL

           •   Microsoft task automation framework built on the .NET framework
                • Command-line shell
                • Scripting language (*.ps1)
           •   Common “shell” to Microsoft technologies (AD, SQL, SP, Server, etc.)
           •   Full access to COM (Component Object Model) and WMI (Windows
               Management Instrumentation) for local and remote system
               management
           •   Replacement to STSADM (deprecated)
           •   PowerShell > STSADM
                • All STSADM operations have a PowerShell equivalent
                • Integrated support for multiple platforms/services (not SP specific)
                • Easily Extendable


1/7/2012                   Making Life Easier with PowerShell   5
Core Concepts

           WORKING WITH POWERSHELL


1/7/2012                   Making Life Easier with PowerShell   6
POWERSHELL SNAP-INS

           •   PowerShell snap-in registers sets of cmdlets and/or providers,
               extending the default functionality of the shell
           •   Similar to a web browser plug-in
           •   Added and removed as needed during user session




1/7/2012                  Making Life Easier with PowerShell   7
POWERSHELL CMDLETS

           •   A cmdlet (“command-let”) is a specific command executed in the
               PowerShell environment
           •   Following a common {verb}-{noun} naming convention, cmdlet
               functions are typically easily understood, ie: Add-PSSnapin, Get-
               SPWeb, etc.
           •   Used like a function, cmdlets take one or more input
               parameters/objects, and output objects or arrays of objects
           •   Cmdlets can be piped together, allowing the output object of one to
               become the input object of another
           •   Objects are always processed individually, if multiple input objects are
               specified, each object will be fully processed before the next is begun




1/7/2012                   Making Life Easier with PowerShell   8
WHEN TO USE POWERSHELL

           •   Making life “easier” with PowerShell should equate to increased
               efficiency, lower cost, and lower turnaround
           •   Identify those processes which are repetitive in nature or those that
               require extended “hands-on” time




1/7/2012                   Making Life Easier with PowerShell   9
GETTING STARTED


           SharePoint 2010
           Management Shell
           PowerShell with the
           SharePoint Snap-in Loaded




1/7/2012                  Making Life Easier with PowerShell   10
STARTING POWERSHELL


           PowerShell 2.0




1/7/2012                    Making Life Easier with PowerShell   11
Demonstration

           CREATE A POWERSHELL PROFILE


1/7/2012                   Making Life Easier with PowerShell   12
SharePoint 2010

           TOP 10 POWERSHELL CMDLETS


1/7/2012                 Making Life Easier with PowerShell   13
GET-HELP

           •   Overview
               • Displays help about Windows PowerShell cmdlets and concepts


           •   Examples
               • Get-Help {cmdlet}
               • Get-Help Test-Path
               • Get-Help Test-Path -Detailed
               • Get-Help Test-Path –Examples
               • Get-Help {topic}
               • Get-Help Snapin




1/7/2012                  Making Life Easier with PowerShell   14
GET-MEMBER

           •   Overview
               • Gets the properties and methods of objects. Specify an object
                 using the InputObject parameter, or pipe an object to Get-Member.


           •   Examples
               • Get-Member –InputObject $object
               • $object | Get-Member




1/7/2012                  Making Life Easier with PowerShell   15
GET-SPFARM

           •   Overview
               • Returns the local SharePoint farm.


           •   Examples
               • Get-SPFarm
               • $farm = Get-SPFarm
                 $farm.Properties




1/7/2012                  Making Life Easier with PowerShell   16
GET-SPWEBAPPLICATION

           •   Overview
               • Returns all web applications that match the given criteria. If no
                 identity is specified, all web applications are returned. The Central
                 Administration web application is ignored unless specified directly
                 or the IncludeCentralAdministration flag is specified.


           •   Examples
               • Get-SPWebApplication
               • Get-SPWebApplication –IncludeCentralAdministration
               • Get-SPWebApplication http://intranet




1/7/2012                  Making Life Easier with PowerShell   17
GET-SPSITE

           •   Overview
               • Returns all the site collections that match the given criteria. If no
                 identity is specified, the farm is scope is used.


           •   Examples
               • Get-SPSite
               • Get-SPSite http://intranet
               • Get-SPSite http://intranet/depts/facilities




1/7/2012                  Making Life Easier with PowerShell   18
GET-SPWEB

           •   Overview
               • Returns all subsites that match the given criteria.


           •   Examples
               • Get-SPWeb http://intranet/depts/HR/benefits
               • Get-SPWeb http://intranet/depts/HR/*
               • Get-SPWeb http://intranet/* –filter {$_.Template –eq “STS#0”}




1/7/2012                  Making Life Easier with PowerShell   19
GET-SPSERVICEAPPLICATION

           •   Overview
               • Returns the specified service application. If no service application
                 is specified, all are returned.


           •   Examples
               • Get-SPServiceApplication
               • Get-SPServiceApplication | select Name, Status




1/7/2012                  Making Life Easier with PowerShell   20
GET-SPCONTENTDATABASE

           •   Overview
               • Returns one or more content databases.


           •   Examples
               • Get-SPContentDatabase
               • Get-SPContentDatabase –WebApplication http://intranet
               • Get-SPContentDatabase –Site http://intranet




1/7/2012                  Making Life Easier with PowerShell   21
TEST-SPCONTENTDATABASE

           •   Overview
               • Tests a content database against a web application to verify all
                 customizations referenced within the content database are also
                 installed in the web application. Content databases do not need to
                 be mounted for validation to complete.


           •   Examples
               • Test-SPContentDatabase –name Lab_Content_Intranet
                      –WebApplication http://intranet




1/7/2012                  Making Life Easier with PowerShell   22
EXPORT-CLIXML & EXPORT-CSV

           •   Overview                                        •   Overview
               • Creates an XML-based                              • Converts objects into a
                 representation of an                                series of comma-
                 object or objects & stores                          separated value strings &
                 in a file.                                          saves file.


           •   Examples                                        •   Examples
               • $sites = Get-SPSite                               • $sites = Get-SPSite
                 Export-Clixml -InputObject                          Export-CSV -InputObject
                     $sites -Path                                        $sites -Path
                 c:sites.xml                                        c:sites.csv
               • Get-SPSite | Export-Clixml                        • Get-SPSite | Export-CSV
                   c:sites.xml                                        c:sites.csvs



1/7/2012                  Making Life Easier with PowerShell           23
Demonstration

           LIST ALL SHAREPOINT CMDLETS


1/7/2012                   Making Life Easier with PowerShell   24
POWERSHELL PIPELINE

           •   The use of the PowerShell Pipeline allows the output object of one cmdlet
               to become the input object of another
           •   “Piping” is performed by using the pipe character “ | ” between cmdlets
           •   Applies to native cmdlets (such as sorting, logical operations, and data
               manipulation) and functional cmdlets (such as those for SharePoint)

                • Logical Example:
                   Get-SPContentDatabase -WebApplication http://intranet | Where
                   {$_.CurrentSiteCount -gt 5}

                • Functional Example:
                   Get-SPSite http://intranet | Get-SPWeb | Enable-SPFeature -Identity
                   “MyFeature”




1/7/2012                   Making Life Easier with PowerShell   25
Demonstration

           USER SCENARIOS


1/7/2012                   Making Life Easier with PowerShell   26
TOOLS & RESOURCES
           •   Tools
                •   Windows PowerShell Integrated Scripting Environment (ISE)
                •   Idera PowerShell Plus (free trial available)
           •   Resources
                •   STSADM -> PowerShell Mapping
                    http://technet.microsoft.com/en-us/library/ff621081.aspx
                •   Scripting with Windows PowerShell (5 part webcast series)
                    http://technet.microsoft.com/en-us/scriptcenter/dd742419
                •   PowerShell Power Hour (monthly lunchtime webcasts)
                    http://idera.com/Education/PowerShell-Webcasts/
                •   SP2010 Visual PowerShell Command Builder
                    http://www.microsoft.com/resources/TechNet/en-
                    us/Office/media/WindowsPowerShell/WindowsPowerShellCommandBuilder.ht
                    ml
                •   Automating Microsoft SharePoint 2010 Administration with Windows
                    PowerShell 2.0. Gary Lapointe, Shannon Bray
                •   Automating Microsoft Windows Server 2008 R2 Administration with Windows
                    PowerShell 2.0. Matthew Hester, Sarah Dutkiewicz



1/7/2012                      Making Life Easier with PowerShell      27
QUESTIONS?
MICHAEL GREENE


@webdes03   mike-greene.com

More Related Content

What's hot

Building a SharePoint Platform That Scales
Building a SharePoint Platform That ScalesBuilding a SharePoint Platform That Scales
Building a SharePoint Platform That ScalesScott Hoag
 
Alfresco Content Modelling and Policy Behaviours
Alfresco Content Modelling and Policy BehavioursAlfresco Content Modelling and Policy Behaviours
Alfresco Content Modelling and Policy BehavioursJ V
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO DevsWO Community
 
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Lucidworks
 
SE2016 - Java EE revisits design patterns 2016
SE2016 - Java EE revisits design patterns 2016SE2016 - Java EE revisits design patterns 2016
SE2016 - Java EE revisits design patterns 2016Alex Theedom
 
Rise of the Single Page Application
Rise of the Single Page ApplicationRise of the Single Page Application
Rise of the Single Page ApplicationPiyush Katariya
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the BasicsUlrich Krause
 
Oozie towards zero downtime
Oozie towards zero downtimeOozie towards zero downtime
Oozie towards zero downtimeDataWorks Summit
 
Data Pipeline Management Framework on Oozie
Data Pipeline Management Framework on OozieData Pipeline Management Framework on Oozie
Data Pipeline Management Framework on OozieShareThis
 
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next LevelMWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next Levelbalassaitis
 
The Solar Framework for PHP 5 (2010 Confoo)
The Solar Framework for PHP 5 (2010 Confoo)The Solar Framework for PHP 5 (2010 Confoo)
The Solar Framework for PHP 5 (2010 Confoo)Paul Jones
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsTeamstudio
 
Organinzing Your PHP Projects (2010 Memphis PHP)
Organinzing Your PHP Projects (2010 Memphis PHP)Organinzing Your PHP Projects (2010 Memphis PHP)
Organinzing Your PHP Projects (2010 Memphis PHP)Paul Jones
 
Plone pas.plugins.ldap user/group search
Plone pas.plugins.ldap user/group searchPlone pas.plugins.ldap user/group search
Plone pas.plugins.ldap user/group searchfredvd
 
RESTful Api practices Rails 3
RESTful Api practices Rails 3RESTful Api practices Rails 3
RESTful Api practices Rails 3Anton Narusberg
 
One Drupal to rule them all - Drupalcamp London
One Drupal to rule them all - Drupalcamp LondonOne Drupal to rule them all - Drupalcamp London
One Drupal to rule them all - Drupalcamp Londonhernanibf
 

What's hot (20)

Building a SharePoint Platform That Scales
Building a SharePoint Platform That ScalesBuilding a SharePoint Platform That Scales
Building a SharePoint Platform That Scales
 
Alfresco Content Modelling and Policy Behaviours
Alfresco Content Modelling and Policy BehavioursAlfresco Content Modelling and Policy Behaviours
Alfresco Content Modelling and Policy Behaviours
 
Html5v1
Html5v1Html5v1
Html5v1
 
Oozie at Yahoo
Oozie at YahooOozie at Yahoo
Oozie at Yahoo
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
 
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
 
SE2016 - Java EE revisits design patterns 2016
SE2016 - Java EE revisits design patterns 2016SE2016 - Java EE revisits design patterns 2016
SE2016 - Java EE revisits design patterns 2016
 
Rise of the Single Page Application
Rise of the Single Page ApplicationRise of the Single Page Application
Rise of the Single Page Application
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics
 
Oozie towards zero downtime
Oozie towards zero downtimeOozie towards zero downtime
Oozie towards zero downtime
 
Data Pipeline Management Framework on Oozie
Data Pipeline Management Framework on OozieData Pipeline Management Framework on Oozie
Data Pipeline Management Framework on Oozie
 
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next LevelMWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
 
The Solar Framework for PHP 5 (2010 Confoo)
The Solar Framework for PHP 5 (2010 Confoo)The Solar Framework for PHP 5 (2010 Confoo)
The Solar Framework for PHP 5 (2010 Confoo)
 
JSP Part 2
JSP Part 2JSP Part 2
JSP Part 2
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
 
Organinzing Your PHP Projects (2010 Memphis PHP)
Organinzing Your PHP Projects (2010 Memphis PHP)Organinzing Your PHP Projects (2010 Memphis PHP)
Organinzing Your PHP Projects (2010 Memphis PHP)
 
Plone pas.plugins.ldap user/group search
Plone pas.plugins.ldap user/group searchPlone pas.plugins.ldap user/group search
Plone pas.plugins.ldap user/group search
 
RESTful Api practices Rails 3
RESTful Api practices Rails 3RESTful Api practices Rails 3
RESTful Api practices Rails 3
 
One Drupal to rule them all - Drupalcamp London
One Drupal to rule them all - Drupalcamp LondonOne Drupal to rule them all - Drupalcamp London
One Drupal to rule them all - Drupalcamp London
 
Crx 2.2 Deep-Dive
Crx 2.2 Deep-DiveCrx 2.2 Deep-Dive
Crx 2.2 Deep-Dive
 

Similar to Making Life Easier with PowerShell (SPSVB 2012)

Spsatx slides (widescreen)
Spsatx slides (widescreen)Spsatx slides (widescreen)
Spsatx slides (widescreen)Ryan Dennis
 
PowerShellForDBDevelopers
PowerShellForDBDevelopersPowerShellForDBDevelopers
PowerShellForDBDevelopersBryan Cafferky
 
Intro to SharePoint + PowerShell
Intro to SharePoint + PowerShellIntro to SharePoint + PowerShell
Intro to SharePoint + PowerShellRyan Dennis
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpChalermpon Areepong
 
PowerShell Introduction to Administering SharePoint On-Premises & O365
PowerShell Introduction to Administering SharePoint On-Premises & O365PowerShell Introduction to Administering SharePoint On-Premises & O365
PowerShell Introduction to Administering SharePoint On-Premises & O365Michael Greene
 
Power shell for sp admins
Power shell for sp adminsPower shell for sp admins
Power shell for sp adminsRick Taylor
 
Supercharge PBCS with PowerShell
Supercharge PBCS with PowerShellSupercharge PBCS with PowerShell
Supercharge PBCS with PowerShellKyle Goodfriend
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh! Chalermpon Areepong
 
PowerShell for SharePoint Admins
PowerShell for SharePoint AdminsPowerShell for SharePoint Admins
PowerShell for SharePoint AdminsRick Taylor
 
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshop
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshopIntroduction to PowerShell - Be a PowerShell Hero - SPFest workshop
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshopMichael Blumenthal (Microsoft MVP)
 
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...HostedbyConfluent
 
PowerShell for the Anxious ITPro
PowerShell for the Anxious ITProPowerShell for the Anxious ITPro
PowerShell for the Anxious ITProJason Himmelstein
 
Build Your First SharePoint Framework Webpart
Build Your First SharePoint Framework WebpartBuild Your First SharePoint Framework Webpart
Build Your First SharePoint Framework WebpartEric Overfield
 
Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP ApplicationsPavan Kumar N
 
API-Testing-SOAPUI-1.pptx
API-Testing-SOAPUI-1.pptxAPI-Testing-SOAPUI-1.pptx
API-Testing-SOAPUI-1.pptxamarnathdeo
 
Introduction to SoapUI day 1
Introduction to SoapUI day 1Introduction to SoapUI day 1
Introduction to SoapUI day 1Qualitest
 
Soap UI - Getting started
Soap UI - Getting startedSoap UI - Getting started
Soap UI - Getting startedQualitest
 
PowerShell for Penetration Testers
PowerShell for Penetration TestersPowerShell for Penetration Testers
PowerShell for Penetration TestersNikhil Mittal
 
Developing Portlets
Developing PortletsDeveloping Portlets
Developing Portletssydeburn
 

Similar to Making Life Easier with PowerShell (SPSVB 2012) (20)

Spsatx slides (widescreen)
Spsatx slides (widescreen)Spsatx slides (widescreen)
Spsatx slides (widescreen)
 
PowerShellForDBDevelopers
PowerShellForDBDevelopersPowerShellForDBDevelopers
PowerShellForDBDevelopers
 
Intro to SharePoint + PowerShell
Intro to SharePoint + PowerShellIntro to SharePoint + PowerShell
Intro to SharePoint + PowerShell
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
 
PowerShell Introduction to Administering SharePoint On-Premises & O365
PowerShell Introduction to Administering SharePoint On-Premises & O365PowerShell Introduction to Administering SharePoint On-Premises & O365
PowerShell Introduction to Administering SharePoint On-Premises & O365
 
Power shell for sp admins
Power shell for sp adminsPower shell for sp admins
Power shell for sp admins
 
Supercharge PBCS with PowerShell
Supercharge PBCS with PowerShellSupercharge PBCS with PowerShell
Supercharge PBCS with PowerShell
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
 
PowerShell for SharePoint Admins
PowerShell for SharePoint AdminsPowerShell for SharePoint Admins
PowerShell for SharePoint Admins
 
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshop
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshopIntroduction to PowerShell - Be a PowerShell Hero - SPFest workshop
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshop
 
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
 
PowerShell for the Anxious ITPro
PowerShell for the Anxious ITProPowerShell for the Anxious ITPro
PowerShell for the Anxious ITPro
 
Plantilla oracle
Plantilla oraclePlantilla oracle
Plantilla oracle
 
Build Your First SharePoint Framework Webpart
Build Your First SharePoint Framework WebpartBuild Your First SharePoint Framework Webpart
Build Your First SharePoint Framework Webpart
 
Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP Applications
 
API-Testing-SOAPUI-1.pptx
API-Testing-SOAPUI-1.pptxAPI-Testing-SOAPUI-1.pptx
API-Testing-SOAPUI-1.pptx
 
Introduction to SoapUI day 1
Introduction to SoapUI day 1Introduction to SoapUI day 1
Introduction to SoapUI day 1
 
Soap UI - Getting started
Soap UI - Getting startedSoap UI - Getting started
Soap UI - Getting started
 
PowerShell for Penetration Testers
PowerShell for Penetration TestersPowerShell for Penetration Testers
PowerShell for Penetration Testers
 
Developing Portlets
Developing PortletsDeveloping Portlets
Developing Portlets
 

More from Michael Greene

Anatomy of an Intranet (Triangle SharePoint User Group) January 2016
Anatomy of an Intranet (Triangle SharePoint User Group) January 2016Anatomy of an Intranet (Triangle SharePoint User Group) January 2016
Anatomy of an Intranet (Triangle SharePoint User Group) January 2016Michael Greene
 
Anatomy of an Intranet (Triangle SharePoint User Group) October 2016
Anatomy of an Intranet (Triangle SharePoint User Group) October 2016Anatomy of an Intranet (Triangle SharePoint User Group) October 2016
Anatomy of an Intranet (Triangle SharePoint User Group) October 2016Michael Greene
 
Anatomy of an Intranet (SPSATL 2014)
Anatomy of an Intranet (SPSATL 2014)Anatomy of an Intranet (SPSATL 2014)
Anatomy of an Intranet (SPSATL 2014)Michael Greene
 
Enhancing SharePoint 2010 for the iPad (Richmond SPUG 10/31/2012)
Enhancing SharePoint 2010 for the iPad (Richmond SPUG 10/31/2012)Enhancing SharePoint 2010 for the iPad (Richmond SPUG 10/31/2012)
Enhancing SharePoint 2010 for the iPad (Richmond SPUG 10/31/2012)Michael Greene
 
ATLSPUG - SharePoint Branding Best Bets
ATLSPUG - SharePoint Branding Best BetsATLSPUG - SharePoint Branding Best Bets
ATLSPUG - SharePoint Branding Best BetsMichael Greene
 
SharePoint Branding Best Bets (SharePoint Saturday Richmond, 2013)
SharePoint Branding Best Bets (SharePoint Saturday Richmond, 2013)SharePoint Branding Best Bets (SharePoint Saturday Richmond, 2013)
SharePoint Branding Best Bets (SharePoint Saturday Richmond, 2013)Michael Greene
 
Making Life Easier with PowerShell (SPSATL 2012)
Making Life Easier with PowerShell (SPSATL 2012)Making Life Easier with PowerShell (SPSATL 2012)
Making Life Easier with PowerShell (SPSATL 2012)Michael Greene
 
Enhancing SharePoint 2010 for the iPad (SPSAusTX 2012)
Enhancing SharePoint 2010 for the iPad (SPSAusTX 2012)Enhancing SharePoint 2010 for the iPad (SPSAusTX 2012)
Enhancing SharePoint 2010 for the iPad (SPSAusTX 2012)Michael Greene
 
Enhancing SharePoint 2010 for the iPad (SPSVB 2012)
Enhancing SharePoint 2010 for the iPad (SPSVB 2012)Enhancing SharePoint 2010 for the iPad (SPSVB 2012)
Enhancing SharePoint 2010 for the iPad (SPSVB 2012)Michael Greene
 
SharePoint Saturday Tampa, Enhancing SharePoint 2010 for the iPad
SharePoint Saturday Tampa, Enhancing SharePoint 2010 for the iPadSharePoint Saturday Tampa, Enhancing SharePoint 2010 for the iPad
SharePoint Saturday Tampa, Enhancing SharePoint 2010 for the iPadMichael Greene
 
Enhancing SharePoint 2010 for the iPad
Enhancing SharePoint 2010 for the iPadEnhancing SharePoint 2010 for the iPad
Enhancing SharePoint 2010 for the iPadMichael Greene
 

More from Michael Greene (11)

Anatomy of an Intranet (Triangle SharePoint User Group) January 2016
Anatomy of an Intranet (Triangle SharePoint User Group) January 2016Anatomy of an Intranet (Triangle SharePoint User Group) January 2016
Anatomy of an Intranet (Triangle SharePoint User Group) January 2016
 
Anatomy of an Intranet (Triangle SharePoint User Group) October 2016
Anatomy of an Intranet (Triangle SharePoint User Group) October 2016Anatomy of an Intranet (Triangle SharePoint User Group) October 2016
Anatomy of an Intranet (Triangle SharePoint User Group) October 2016
 
Anatomy of an Intranet (SPSATL 2014)
Anatomy of an Intranet (SPSATL 2014)Anatomy of an Intranet (SPSATL 2014)
Anatomy of an Intranet (SPSATL 2014)
 
Enhancing SharePoint 2010 for the iPad (Richmond SPUG 10/31/2012)
Enhancing SharePoint 2010 for the iPad (Richmond SPUG 10/31/2012)Enhancing SharePoint 2010 for the iPad (Richmond SPUG 10/31/2012)
Enhancing SharePoint 2010 for the iPad (Richmond SPUG 10/31/2012)
 
ATLSPUG - SharePoint Branding Best Bets
ATLSPUG - SharePoint Branding Best BetsATLSPUG - SharePoint Branding Best Bets
ATLSPUG - SharePoint Branding Best Bets
 
SharePoint Branding Best Bets (SharePoint Saturday Richmond, 2013)
SharePoint Branding Best Bets (SharePoint Saturday Richmond, 2013)SharePoint Branding Best Bets (SharePoint Saturday Richmond, 2013)
SharePoint Branding Best Bets (SharePoint Saturday Richmond, 2013)
 
Making Life Easier with PowerShell (SPSATL 2012)
Making Life Easier with PowerShell (SPSATL 2012)Making Life Easier with PowerShell (SPSATL 2012)
Making Life Easier with PowerShell (SPSATL 2012)
 
Enhancing SharePoint 2010 for the iPad (SPSAusTX 2012)
Enhancing SharePoint 2010 for the iPad (SPSAusTX 2012)Enhancing SharePoint 2010 for the iPad (SPSAusTX 2012)
Enhancing SharePoint 2010 for the iPad (SPSAusTX 2012)
 
Enhancing SharePoint 2010 for the iPad (SPSVB 2012)
Enhancing SharePoint 2010 for the iPad (SPSVB 2012)Enhancing SharePoint 2010 for the iPad (SPSVB 2012)
Enhancing SharePoint 2010 for the iPad (SPSVB 2012)
 
SharePoint Saturday Tampa, Enhancing SharePoint 2010 for the iPad
SharePoint Saturday Tampa, Enhancing SharePoint 2010 for the iPadSharePoint Saturday Tampa, Enhancing SharePoint 2010 for the iPad
SharePoint Saturday Tampa, Enhancing SharePoint 2010 for the iPad
 
Enhancing SharePoint 2010 for the iPad
Enhancing SharePoint 2010 for the iPadEnhancing SharePoint 2010 for the iPad
Enhancing SharePoint 2010 for the iPad
 

Recently uploaded

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

Making Life Easier with PowerShell (SPSVB 2012)

  • 1. MAKING LIFE EASIER WITH POWERSHELL January 7, 2012
  • 2.
  • 3. AGENDA • What is PowerShell • Working with PowerShell • When to Use PowerShell • Top 10 SharePoint 2010 Cmdlets • Using the PowerShell Pipeline • User Scenarios • Tools & Resources 1/7/2012 Making Life Easier with PowerShell 3
  • 4. Core Concepts WHAT IS POWERSHELL 1/7/2012 Making Life Easier with PowerShell 4
  • 5. WHAT IS POWERSHELL • Microsoft task automation framework built on the .NET framework • Command-line shell • Scripting language (*.ps1) • Common “shell” to Microsoft technologies (AD, SQL, SP, Server, etc.) • Full access to COM (Component Object Model) and WMI (Windows Management Instrumentation) for local and remote system management • Replacement to STSADM (deprecated) • PowerShell > STSADM • All STSADM operations have a PowerShell equivalent • Integrated support for multiple platforms/services (not SP specific) • Easily Extendable 1/7/2012 Making Life Easier with PowerShell 5
  • 6. Core Concepts WORKING WITH POWERSHELL 1/7/2012 Making Life Easier with PowerShell 6
  • 7. POWERSHELL SNAP-INS • PowerShell snap-in registers sets of cmdlets and/or providers, extending the default functionality of the shell • Similar to a web browser plug-in • Added and removed as needed during user session 1/7/2012 Making Life Easier with PowerShell 7
  • 8. POWERSHELL CMDLETS • A cmdlet (“command-let”) is a specific command executed in the PowerShell environment • Following a common {verb}-{noun} naming convention, cmdlet functions are typically easily understood, ie: Add-PSSnapin, Get- SPWeb, etc. • Used like a function, cmdlets take one or more input parameters/objects, and output objects or arrays of objects • Cmdlets can be piped together, allowing the output object of one to become the input object of another • Objects are always processed individually, if multiple input objects are specified, each object will be fully processed before the next is begun 1/7/2012 Making Life Easier with PowerShell 8
  • 9. WHEN TO USE POWERSHELL • Making life “easier” with PowerShell should equate to increased efficiency, lower cost, and lower turnaround • Identify those processes which are repetitive in nature or those that require extended “hands-on” time 1/7/2012 Making Life Easier with PowerShell 9
  • 10. GETTING STARTED SharePoint 2010 Management Shell PowerShell with the SharePoint Snap-in Loaded 1/7/2012 Making Life Easier with PowerShell 10
  • 11. STARTING POWERSHELL PowerShell 2.0 1/7/2012 Making Life Easier with PowerShell 11
  • 12. Demonstration CREATE A POWERSHELL PROFILE 1/7/2012 Making Life Easier with PowerShell 12
  • 13. SharePoint 2010 TOP 10 POWERSHELL CMDLETS 1/7/2012 Making Life Easier with PowerShell 13
  • 14. GET-HELP • Overview • Displays help about Windows PowerShell cmdlets and concepts • Examples • Get-Help {cmdlet} • Get-Help Test-Path • Get-Help Test-Path -Detailed • Get-Help Test-Path –Examples • Get-Help {topic} • Get-Help Snapin 1/7/2012 Making Life Easier with PowerShell 14
  • 15. GET-MEMBER • Overview • Gets the properties and methods of objects. Specify an object using the InputObject parameter, or pipe an object to Get-Member. • Examples • Get-Member –InputObject $object • $object | Get-Member 1/7/2012 Making Life Easier with PowerShell 15
  • 16. GET-SPFARM • Overview • Returns the local SharePoint farm. • Examples • Get-SPFarm • $farm = Get-SPFarm $farm.Properties 1/7/2012 Making Life Easier with PowerShell 16
  • 17. GET-SPWEBAPPLICATION • Overview • Returns all web applications that match the given criteria. If no identity is specified, all web applications are returned. The Central Administration web application is ignored unless specified directly or the IncludeCentralAdministration flag is specified. • Examples • Get-SPWebApplication • Get-SPWebApplication –IncludeCentralAdministration • Get-SPWebApplication http://intranet 1/7/2012 Making Life Easier with PowerShell 17
  • 18. GET-SPSITE • Overview • Returns all the site collections that match the given criteria. If no identity is specified, the farm is scope is used. • Examples • Get-SPSite • Get-SPSite http://intranet • Get-SPSite http://intranet/depts/facilities 1/7/2012 Making Life Easier with PowerShell 18
  • 19. GET-SPWEB • Overview • Returns all subsites that match the given criteria. • Examples • Get-SPWeb http://intranet/depts/HR/benefits • Get-SPWeb http://intranet/depts/HR/* • Get-SPWeb http://intranet/* –filter {$_.Template –eq “STS#0”} 1/7/2012 Making Life Easier with PowerShell 19
  • 20. GET-SPSERVICEAPPLICATION • Overview • Returns the specified service application. If no service application is specified, all are returned. • Examples • Get-SPServiceApplication • Get-SPServiceApplication | select Name, Status 1/7/2012 Making Life Easier with PowerShell 20
  • 21. GET-SPCONTENTDATABASE • Overview • Returns one or more content databases. • Examples • Get-SPContentDatabase • Get-SPContentDatabase –WebApplication http://intranet • Get-SPContentDatabase –Site http://intranet 1/7/2012 Making Life Easier with PowerShell 21
  • 22. TEST-SPCONTENTDATABASE • Overview • Tests a content database against a web application to verify all customizations referenced within the content database are also installed in the web application. Content databases do not need to be mounted for validation to complete. • Examples • Test-SPContentDatabase –name Lab_Content_Intranet –WebApplication http://intranet 1/7/2012 Making Life Easier with PowerShell 22
  • 23. EXPORT-CLIXML & EXPORT-CSV • Overview • Overview • Creates an XML-based • Converts objects into a representation of an series of comma- object or objects & stores separated value strings & in a file. saves file. • Examples • Examples • $sites = Get-SPSite • $sites = Get-SPSite Export-Clixml -InputObject Export-CSV -InputObject $sites -Path $sites -Path c:sites.xml c:sites.csv • Get-SPSite | Export-Clixml • Get-SPSite | Export-CSV c:sites.xml c:sites.csvs 1/7/2012 Making Life Easier with PowerShell 23
  • 24. Demonstration LIST ALL SHAREPOINT CMDLETS 1/7/2012 Making Life Easier with PowerShell 24
  • 25. POWERSHELL PIPELINE • The use of the PowerShell Pipeline allows the output object of one cmdlet to become the input object of another • “Piping” is performed by using the pipe character “ | ” between cmdlets • Applies to native cmdlets (such as sorting, logical operations, and data manipulation) and functional cmdlets (such as those for SharePoint) • Logical Example: Get-SPContentDatabase -WebApplication http://intranet | Where {$_.CurrentSiteCount -gt 5} • Functional Example: Get-SPSite http://intranet | Get-SPWeb | Enable-SPFeature -Identity “MyFeature” 1/7/2012 Making Life Easier with PowerShell 25
  • 26. Demonstration USER SCENARIOS 1/7/2012 Making Life Easier with PowerShell 26
  • 27. TOOLS & RESOURCES • Tools • Windows PowerShell Integrated Scripting Environment (ISE) • Idera PowerShell Plus (free trial available) • Resources • STSADM -> PowerShell Mapping http://technet.microsoft.com/en-us/library/ff621081.aspx • Scripting with Windows PowerShell (5 part webcast series) http://technet.microsoft.com/en-us/scriptcenter/dd742419 • PowerShell Power Hour (monthly lunchtime webcasts) http://idera.com/Education/PowerShell-Webcasts/ • SP2010 Visual PowerShell Command Builder http://www.microsoft.com/resources/TechNet/en- us/Office/media/WindowsPowerShell/WindowsPowerShellCommandBuilder.ht ml • Automating Microsoft SharePoint 2010 Administration with Windows PowerShell 2.0. Gary Lapointe, Shannon Bray • Automating Microsoft Windows Server 2008 R2 Administration with Windows PowerShell 2.0. Matthew Hester, Sarah Dutkiewicz 1/7/2012 Making Life Easier with PowerShell 27
  • 29. MICHAEL GREENE @webdes03 mike-greene.com

Editor's Notes

  1. Test-Path $profileIf result is FALSENew-Item –type file –force $profileNotepad $profile
  2. Get-Command -PSSnapin “Microsoft.SharePoint.Powershell”
  3. Idera, $199 per user