SlideShare a Scribd company logo
Western Mass Microsoft User
Group--Using Powershell to
         Manage SharePoint    1/11/2012   1
   Craig Pilkenton
    o SharePoint Engineer at MassMutual
     • Enterprise User Group Lead
     • SharePoint Trainer




    o Western Mass Microsoft User Group: Co-Lead
      (http://mstech.org)
    o LinkedIn.com
      (http://www.linkedin.com/in/craigpilkenton)

                                    Western Mass Microsoft User
                                    Group--Using Powershell to
                                             Manage SharePoint    1/11/2012   2
   Overview: what is Windows Powershell
   What can('t) it do?
   Managing Server‟s
   Managing SharePoint
   Updating SharePoint
   Take-Away‟s




                         Western Mass Microsoft User
                         Group--Using Powershell to
                                  Manage SharePoint    1/11/2012   3
   What is Windows Powershell?
    o Powershell is the new extensible command-line shell we
      can run on any Windows Server or desktop that allows
      for automating administrative tasks, executing any other
      command-line toolset, or for calling any regular .NET
      class, including those for the SharePoint platform.
   What does this really mean?
    o Powershell allows for automating repetitive maintenance
      tasks, modularizing scripts to “snap-on” future
      functionality, built-in enumeration objects, and calling any
      other command-line or .NET object to get work done (e.g.
      FTP, file-shares, email, etc.). Everything that is queried or
      returned to us is an „object‟ that has all of the available
      properties and methods.
                                      Western Mass Microsoft User
                                      Group--Using Powershell to
                                               Manage SharePoint    1/11/2012   4
   What does Powershell look like?




                           Western Mass Microsoft User
                           Group--Using Powershell to
                                    Manage SharePoint    1/11/2012   5
   Demo : Usage and interaction




                         Western Mass Microsoft User
                         Group--Using Powershell to
                                  Manage SharePoint    1/11/2012   6
   Monitor server status & activate (Get-Service, Get-
    EventLog, dir/ls, Stop-Service, Restart-Service)
   Import/export files for processing or reports (Import-
    Csv, Export-Csv, Out-File, Copy-Item, FTP)
   Call other command-line utilities
    (STSADM.exe, RoboCopy, Team Foundation Server, WinZip)
   Instantiate .NET objects to use their functionality
    (Email, FileInfo, ArrayList, Hashtable)
   Instantiate SharePoint‟s .NET objects to manage the platform
    (Site-level, subweb-level, Document Library/List-
    level, permission-level)
   And just about anything else…
                                   Western Mass Microsoft User
                                   Group--Using Powershell to
                                            Manage SharePoint    1/11/2012   7
   Many out-of-the-box cmdlets
   Not just informational, but reaction-able
    o Get-Service
     Stop-Service and/or Restart-Service can be fired as
      logic determines
    o Get-EventLog
     Watch for certain events and then fire other
      cmdlets, applications, or cmdlets in response
    o dir/ls (Get-ChildItem)
     Can look for files existing and if not, take action to
      get or remove

                                 Western Mass Microsoft User
                                 Group--Using Powershell to
                                          Manage SharePoint    1/11/2012   8
   Demo : Monitoring our server, and reacting
    to it




                          Western Mass Microsoft User
                          Group--Using Powershell to
                                   Manage SharePoint    1/11/2012   9
   Everything returned is a SharePoint object
   A „Site‟ object is instantiated AND must be
    disposed of when finished
    o Load the Microsoft.SharePoint .NET 2.0 object into
      memory
    o Create a „New-Object‟ to store the SharePoint site
      inside of
    o Begin querying the new object for its
      properties, methods, and stored values; some of
      which may be other SharePoint objects and/or
      collections themselves

                               Western Mass Microsoft User
                               Group--Using Powershell to
                                        Manage SharePoint    1/11/2012   10
   Demo: Checking on our SharePoint
    environment




                        Western Mass Microsoft User
                        Group--Using Powershell to
                                 Manage SharePoint    1/11/2012   11
   We still have a handle to the SharePoint site
    object to manipulate
   So what does it take?
    o We open a new SubWeb object (but this can be done
      at any level)
    o Inside of our SubWeb object, create a new List
      object
    o On the new List object, create an instance of an
      item, add column-value pairs that match the
      SharePoint List,
    o Finally call the .Update() method to add new item

                              Western Mass Microsoft User
                              Group--Using Powershell to
                                       Manage SharePoint    1/11/2012   12
   Demo: Add a new Announcement to our
    SharePoint site




                       Western Mass Microsoft User
                       Group--Using Powershell to
                                Manage SharePoint    1/11/2012   13
   Powershell can manage any Microsoft server
    or platform (some actually have inherent
    cmdlets available e.g. Exchange
    2007, SQL, etc.)
   Not only is Microsoft moving all
    server/platforms to this model, many
    vendors are doing the same with their
    software packages and/or tools
   Powershell not only talks to almost any
    command-line interface, but allows for
    reflexive decisions based on that data
                         Western Mass Microsoft User
                         Group--Using Powershell to
                                  Manage SharePoint    1/11/2012   14
   Links
    o Windows Powershell Team
     http://blogs.msdn.com/powershell/
    o PowershellCommunity.org
     http://www.powershellcommunity.org/
    o Microsoft Online—Windows SharePoint Services
     http://office.microsoft.com/en-
      us/sharepointtechnology/FX100503841033.aspx




                              Western Mass Microsoft User
                              Group--Using Powershell to
                                       Manage SharePoint    1/11/2012   15

More Related Content

Viewers also liked (7)

PDF
SharePoint Performance at SPS Philly
Sentri
 
PDF
Le filament magazine 31 de juillet et aout 2013
Patrice Piardon
 
PPT
SharePoint Administration with PowerShell
Eric Kraus
 
PDF
SharePoint logging & debugging
Sentri
 
PPTX
Sentri Webinar: Windows Azure Overview
Sentri
 
PDF
SystemCenter webinar 12 6 12
Sentri
 
PDF
Heavy Metal PowerPivot Remastered - Experts Conference
Sentri
 
SharePoint Performance at SPS Philly
Sentri
 
Le filament magazine 31 de juillet et aout 2013
Patrice Piardon
 
SharePoint Administration with PowerShell
Eric Kraus
 
SharePoint logging & debugging
Sentri
 
Sentri Webinar: Windows Azure Overview
Sentri
 
SystemCenter webinar 12 6 12
Sentri
 
Heavy Metal PowerPivot Remastered - Experts Conference
Sentri
 

Similar to Using Powershell to manage SharePoint (20)

PPTX
Using PowerShell for SharePoint 2013
Nikolas Charlebois-Laprade
 
PPTX
Intro to SharePoint + PowerShell
Ryan Dennis
 
PPTX
Automating PowerShell with SharePoint
Talbott Crowell
 
PDF
PowerShell for SharePoint Developers
Boulos Dib
 
PPTX
Automating Your Enterprise Application Deployments With PowerShell by Geoff V...
SPTechCon
 
PDF
Introduction to PowerShell
Boulos Dib
 
PPTX
Power shell for sp admins
Rick Taylor
 
PDF
Automating Your Enterprise Application Deployments with PowerShell
Geoff Varosky
 
PPTX
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshop
Michael Blumenthal (Microsoft MVP)
 
PPTX
PowerShell Basics for Office Apps and Servers
Greg McMurray
 
PDF
Operacion Guinda 2
Red RADAR
 
PPTX
Intro to PowerShell
Adam Preston
 
PPTX
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
PPTX
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
PPTX
Intro to Powershell
Dean Willson
 
PPTX
Introduction to PowerShell for SharePoint Admins and Developers - SharePoint ...
Michael Blumenthal (Microsoft MVP)
 
PPTX
Making Life Easier with PowerShell (SPSVB 2012)
Michael Greene
 
PPTX
Automating Enterprise Application Deployments with PowerShell
Geoff Varosky
 
PPTX
Spsatx slides (widescreen)
Ryan Dennis
 
DOCX
Power shell
Rajkiran Swain
 
Using PowerShell for SharePoint 2013
Nikolas Charlebois-Laprade
 
Intro to SharePoint + PowerShell
Ryan Dennis
 
Automating PowerShell with SharePoint
Talbott Crowell
 
PowerShell for SharePoint Developers
Boulos Dib
 
Automating Your Enterprise Application Deployments With PowerShell by Geoff V...
SPTechCon
 
Introduction to PowerShell
Boulos Dib
 
Power shell for sp admins
Rick Taylor
 
Automating Your Enterprise Application Deployments with PowerShell
Geoff Varosky
 
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshop
Michael Blumenthal (Microsoft MVP)
 
PowerShell Basics for Office Apps and Servers
Greg McMurray
 
Operacion Guinda 2
Red RADAR
 
Intro to PowerShell
Adam Preston
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
Intro to Powershell
Dean Willson
 
Introduction to PowerShell for SharePoint Admins and Developers - SharePoint ...
Michael Blumenthal (Microsoft MVP)
 
Making Life Easier with PowerShell (SPSVB 2012)
Michael Greene
 
Automating Enterprise Application Deployments with PowerShell
Geoff Varosky
 
Spsatx slides (widescreen)
Ryan Dennis
 
Power shell
Rajkiran Swain
 
Ad

Recently uploaded (20)

PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PPTX
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
PPTX
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PPTX
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
PDF
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
PDF
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
PDF
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
PDF
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
PDF
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
PPTX
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
WSO2
 
PDF
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
PDF
Understanding AI Optimization AIO, LLMO, and GEO
CoDigital
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
WSO2
 
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
Understanding AI Optimization AIO, LLMO, and GEO
CoDigital
 
Ad

Using Powershell to manage SharePoint

  • 1. Western Mass Microsoft User Group--Using Powershell to Manage SharePoint 1/11/2012 1
  • 2. Craig Pilkenton o SharePoint Engineer at MassMutual • Enterprise User Group Lead • SharePoint Trainer o Western Mass Microsoft User Group: Co-Lead (http://mstech.org) o LinkedIn.com (http://www.linkedin.com/in/craigpilkenton) Western Mass Microsoft User Group--Using Powershell to Manage SharePoint 1/11/2012 2
  • 3. Overview: what is Windows Powershell  What can('t) it do?  Managing Server‟s  Managing SharePoint  Updating SharePoint  Take-Away‟s Western Mass Microsoft User Group--Using Powershell to Manage SharePoint 1/11/2012 3
  • 4. What is Windows Powershell? o Powershell is the new extensible command-line shell we can run on any Windows Server or desktop that allows for automating administrative tasks, executing any other command-line toolset, or for calling any regular .NET class, including those for the SharePoint platform.  What does this really mean? o Powershell allows for automating repetitive maintenance tasks, modularizing scripts to “snap-on” future functionality, built-in enumeration objects, and calling any other command-line or .NET object to get work done (e.g. FTP, file-shares, email, etc.). Everything that is queried or returned to us is an „object‟ that has all of the available properties and methods. Western Mass Microsoft User Group--Using Powershell to Manage SharePoint 1/11/2012 4
  • 5. What does Powershell look like? Western Mass Microsoft User Group--Using Powershell to Manage SharePoint 1/11/2012 5
  • 6. Demo : Usage and interaction Western Mass Microsoft User Group--Using Powershell to Manage SharePoint 1/11/2012 6
  • 7. Monitor server status & activate (Get-Service, Get- EventLog, dir/ls, Stop-Service, Restart-Service)  Import/export files for processing or reports (Import- Csv, Export-Csv, Out-File, Copy-Item, FTP)  Call other command-line utilities (STSADM.exe, RoboCopy, Team Foundation Server, WinZip)  Instantiate .NET objects to use their functionality (Email, FileInfo, ArrayList, Hashtable)  Instantiate SharePoint‟s .NET objects to manage the platform (Site-level, subweb-level, Document Library/List- level, permission-level)  And just about anything else… Western Mass Microsoft User Group--Using Powershell to Manage SharePoint 1/11/2012 7
  • 8. Many out-of-the-box cmdlets  Not just informational, but reaction-able o Get-Service Stop-Service and/or Restart-Service can be fired as logic determines o Get-EventLog Watch for certain events and then fire other cmdlets, applications, or cmdlets in response o dir/ls (Get-ChildItem) Can look for files existing and if not, take action to get or remove Western Mass Microsoft User Group--Using Powershell to Manage SharePoint 1/11/2012 8
  • 9. Demo : Monitoring our server, and reacting to it Western Mass Microsoft User Group--Using Powershell to Manage SharePoint 1/11/2012 9
  • 10. Everything returned is a SharePoint object  A „Site‟ object is instantiated AND must be disposed of when finished o Load the Microsoft.SharePoint .NET 2.0 object into memory o Create a „New-Object‟ to store the SharePoint site inside of o Begin querying the new object for its properties, methods, and stored values; some of which may be other SharePoint objects and/or collections themselves Western Mass Microsoft User Group--Using Powershell to Manage SharePoint 1/11/2012 10
  • 11. Demo: Checking on our SharePoint environment Western Mass Microsoft User Group--Using Powershell to Manage SharePoint 1/11/2012 11
  • 12. We still have a handle to the SharePoint site object to manipulate  So what does it take? o We open a new SubWeb object (but this can be done at any level) o Inside of our SubWeb object, create a new List object o On the new List object, create an instance of an item, add column-value pairs that match the SharePoint List, o Finally call the .Update() method to add new item Western Mass Microsoft User Group--Using Powershell to Manage SharePoint 1/11/2012 12
  • 13. Demo: Add a new Announcement to our SharePoint site Western Mass Microsoft User Group--Using Powershell to Manage SharePoint 1/11/2012 13
  • 14. Powershell can manage any Microsoft server or platform (some actually have inherent cmdlets available e.g. Exchange 2007, SQL, etc.)  Not only is Microsoft moving all server/platforms to this model, many vendors are doing the same with their software packages and/or tools  Powershell not only talks to almost any command-line interface, but allows for reflexive decisions based on that data Western Mass Microsoft User Group--Using Powershell to Manage SharePoint 1/11/2012 14
  • 15. Links o Windows Powershell Team http://blogs.msdn.com/powershell/ o PowershellCommunity.org http://www.powershellcommunity.org/ o Microsoft Online—Windows SharePoint Services http://office.microsoft.com/en- us/sharepointtechnology/FX100503841033.aspx Western Mass Microsoft User Group--Using Powershell to Manage SharePoint 1/11/2012 15