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

PDF
Using MS-SQL Server with Visual DataFlex
PDF
XOOPS Headlines Module Tutorial
PPTX
Database component in mule demo
PDF
XOOPS 2.5.x Installation Guide
PDF
XOOPS 2.5.x Operations Guide
PPTX
Managing database project with Visual Studio SSDT and TFS
PPT
Anypoint data gateway
PPT
Liquibase – a time machine for your data
Using MS-SQL Server with Visual DataFlex
XOOPS Headlines Module Tutorial
Database component in mule demo
XOOPS 2.5.x Installation Guide
XOOPS 2.5.x Operations Guide
Managing database project with Visual Studio SSDT and TFS
Anypoint data gateway
Liquibase – a time machine for your data

Viewers also liked (7)

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

Similar to Using Powershell to manage SharePoint (20)

PPTX
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
PPTX
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
PPTX
Intro to SharePoint + PowerShell
PPT
PHPExcel and OPENXML4J
DOCX
Resume_Abhinav_Hadoop_Developer
PPTX
Using rest to create responsive html 5 share point intranets
PPTX
Spsatx slides (widescreen)
PPTX
Core SharePoint 2013 Concepts
PPTX
SharePoint 2010 - What's New?
PPTX
Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...
PPT
2004 01 10 Chef Sa V01
DOCX
CONTENT MANAGEMENT SYSTEM
PDF
Things Made Easy: One Click CMS Integration with Solr & Drupal
PPTX
SharePoint 2010 Tools in Visual Studio 2010
PDF
Share point review qustions
PPT
Sql And Storage Considerations For Share Point Server 2010
PPTX
Sharepoint 2010 overview - what it is and what it can do
DOCX
Int quest
PPTX
Introduction to using jQuery with SharePoint
PPTX
Accelerate your journey to the cloud using the Microsoft SharePoint Migration...
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Intro to SharePoint + PowerShell
PHPExcel and OPENXML4J
Resume_Abhinav_Hadoop_Developer
Using rest to create responsive html 5 share point intranets
Spsatx slides (widescreen)
Core SharePoint 2013 Concepts
SharePoint 2010 - What's New?
Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...
2004 01 10 Chef Sa V01
CONTENT MANAGEMENT SYSTEM
Things Made Easy: One Click CMS Integration with Solr & Drupal
SharePoint 2010 Tools in Visual Studio 2010
Share point review qustions
Sql And Storage Considerations For Share Point Server 2010
Sharepoint 2010 overview - what it is and what it can do
Int quest
Introduction to using jQuery with SharePoint
Accelerate your journey to the cloud using the Microsoft SharePoint Migration...
Ad

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
sap open course for s4hana steps from ECC to s4
PPT
Teaching material agriculture food technology
PDF
Encapsulation theory and applications.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Spectroscopy.pptx food analysis technology
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
Digital-Transformation-Roadmap-for-Companies.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Big Data Technologies - Introduction.pptx
Programs and apps: productivity, graphics, security and other tools
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Empathic Computing: Creating Shared Understanding
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Unlocking AI with Model Context Protocol (MCP)
The Rise and Fall of 3GPP – Time for a Sabbatical?
The AUB Centre for AI in Media Proposal.docx
sap open course for s4hana steps from ECC to s4
Teaching material agriculture food technology
Encapsulation theory and applications.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Spectroscopy.pptx food analysis technology
Advanced methodologies resolving dimensionality complications for autism neur...

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