SlideShare a Scribd company logo
Getting Started with
SharePoint + PowerShell
       Ryan Dennis
    @SharePointRyan
  www.SharePointRyan.com
Learn PowerShell. 24/7, Anywhere.




 Enter POWERSAT at checkout to save
      $50 on any training course.
          www.TRAINSIGNAL.com
SeeShell
            Simple and Effective
             Data Visualization
              For PowerShell

              Use Coupon Code
                 PSSAT002
               And save 20%

http://www.codeowls.com/seeshell
About The Speaker
Ryan Dennis, MCTS, MCPD, MCITP
Senior SharePoint Engineer @ ICC
Microsoft Virtual Technology Specialist (vTSP)


        www.SharePointRyan.com
        @SharePointRyan
        linkedin.com/in/sharepointryan
        ryan@sharepointryan.com
Windows PowerShell
…is a task-based command-line shell and
scripting language designed especially for
Windows system administration

…has a task-based scripting language

…includes powerful object manipulation
capabilities

…is built on the .NET Framework
Verb-Noun
PowerShell uses a Verb-Noun syntax for its
Cmdlets
• Get-Something
• Set-Something
• New-Something
• Remove-Something
Get-Command & Get-Help
• While you can do a lot of the same things
  as the typical command prompt, use Get-
  Command to see available commands
• Use Get-Help <cmdlet> to get help
  information for a cmdlet
Using PowerShell Profiles
• PowerShell uses 2 profiles, a user specific
  profile and a machine-wide profile…
• Use profiles to pre-load
  scripts, functions, environmental
  variables, shell settings, aliases, etc.
Script Editors & Tools
• Notepad.exe (Lame)
• Notepad++ (Less Lame)
• Windows PowerShell ISE (Pretty Good -
  includes IntelliSense, Syntax highlighting)
• Quest PowerGUI (Awesome – Adds
  advanced debugging, and other cool
  things – don’t worry, I’ll show you!)
• Others…
SharePoint 2010 Cmdlets
• 500+ Cmdlets…
• MUCH better than STSADM.exe…
• Can automate complete installations and
  configurations…
• Still doesn’t answer every scenario, leaving
  gaps in functionality…
  – Example: Get, New and Remove SharePoint
    Groups – no cmdlet, easy to write a custom
    function though…
Creating a SharePoint Web Application using out-of-the-box
PowerShell Cmdlets

           DEMONSTRATION
Demo Recap
• Used New-SPWebApplication to create a
  new SharePoint Web Application…
• Stored the SPWebApplication object into
  the $webapp variable
• Used Get-Member to view Methods and
  Properties associated with the Web
  Application
Creating a SharePoint Site Collection using out-of-the-box
PowerShell Cmdlets

     DEMONSTRATION TWO
Demo Recap
• Used New-SPSite to create a new SharePoint Site
  Collection…
• Stored the SPSite object into the $site variable
• Created a $web variable from $site.rootweb
• Used the $web variable to change the Site Title
  using the SP Object Model
• Used Get-History and Pipeline to create a simple
  script from our command history…
• Cool right, but what if we could make this
  reusable???  (Hint: we can)
Extending PowerShell with Scripts
          and Functions
• PowerShell Scripts have .ps1 file extension…
• Scripts and functions behave similarly if not
  identically, but functions are more reusable…
• Scripts can reference functions and cmdlets…
• Functions can include other functions within
  them and can also reference cmdlets…
Using what we already learned and making it better.

  DEMONSTRATION THREE
Demo Recap
• Used the following cmdlets in conjunction with the
  pipeline to automagically build a function based on
  what we did in our first demonstration:
   – Get-History
   – Select-Object
   – Out-File
• Used Quest PowerGUI to edit our function by
  adding Parameters, eliminating hard-coded values…
• Added comment-based help from PowerGUI
  Snippet…
• Tried out our cool, new function…
The Power IS in the Shell, Use it
             Wisely!
• PowerShell is VERY powerful, be aware of
  memory issues...
• Use dispose() method for Site and Web
  objects, or better yet…
• Use Start-SPAssignment –Global to capture all
  objects in the Global store, then use
  Stop-SPAssignment –Global to dispose of all
  objects…
Get-Resources
1.   TechNet for general PowerShell information…
2.   The Hey, Scripting Guy! blog
3.   Get-SPScripts.com
4.   Gary Lapointe
5.   Get-Help in a PowerShell window…
6.   SharePointRyan.com (yes, my blog)…
Got-Questions -?
Ryan Dennis, MCTS, MCPD, MCITP
Senior SharePoint Engineer @ ICC
Microsoft Virtual Technology Specialist (vTSP)


        www.SharePointRyan.com
        @SharePointRyan
        linkedin.com/in/sharepointryan
        ryan@sharepointryan.com

More Related Content

PDF
PowerShell for SharePoint Developers
PPTX
PowerShell for SharePoint Admins
PPTX
PowerShell for sharepoint 2010 administrators
PPTX
SharePoint PowerShell for the Admin and Developer - A Venn Diagram Experience
PPTX
SP24S053 Introduction to PowerShell for SharePoint Developers and Administrators
PDF
JavaScript and jQuery for SharePoint Developers
PPTX
Introduction to laravel framework
PPTX
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
PowerShell for SharePoint Developers
PowerShell for SharePoint Admins
PowerShell for sharepoint 2010 administrators
SharePoint PowerShell for the Admin and Developer - A Venn Diagram Experience
SP24S053 Introduction to PowerShell for SharePoint Developers and Administrators
JavaScript and jQuery for SharePoint Developers
Introduction to laravel framework
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra

What's hot (20)

PPTX
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
PPTX
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
PPTX
Laravel ppt
PPT
What Is Hobo ?
PPTX
PowerShell and SharePoint
PPTX
Power shell for sp admins
PPT
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
PDF
Laravel presentation
PPTX
Laravel Tutorial PPT
PDF
Laravel Introduction
PPTX
Laravel overview
PPTX
SenchaCon 2016: Upgrading an Ext JS 4.x Application to Ext JS 6.x - Mark Linc...
PPTX
Getting started with laravel
PDF
Backbone.js Architecture Example - Echoes Media Player (Hebrew)
PDF
Best Practices for WordPress
PPTX
SharePoint Development 101
PDF
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
PDF
Here Be Dragons - Debugging WordPress
PDF
Isomorphic WordPress Applications with NodeifyWP
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
Laravel ppt
What Is Hobo ?
PowerShell and SharePoint
Power shell for sp admins
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
Laravel presentation
Laravel Tutorial PPT
Laravel Introduction
Laravel overview
SenchaCon 2016: Upgrading an Ext JS 4.x Application to Ext JS 6.x - Mark Linc...
Getting started with laravel
Backbone.js Architecture Example - Echoes Media Player (Hebrew)
Best Practices for WordPress
SharePoint Development 101
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Here Be Dragons - Debugging WordPress
Isomorphic WordPress Applications with NodeifyWP
Ad

Viewers also liked (6)

PPTX
So You Want to Be a SharePoint Developer - SPS Utah 2015
PPTX
SharePoint Saturday Silicon Valley - SharePoint Apps - Ryan Schouten
PPTX
So You Want To Be A SharePoint Developer-SPS Silicon Valley 2015
DOC
SharePoint Online App Model Guidance
PPTX
SharePoint Saturday Cincinnati 2014 - CSOM
PPTX
Using office add ins to solve business problems-SharePoint Saturday Redmond 2015
So You Want to Be a SharePoint Developer - SPS Utah 2015
SharePoint Saturday Silicon Valley - SharePoint Apps - Ryan Schouten
So You Want To Be A SharePoint Developer-SPS Silicon Valley 2015
SharePoint Online App Model Guidance
SharePoint Saturday Cincinnati 2014 - CSOM
Using office add ins to solve business problems-SharePoint Saturday Redmond 2015
Ad

Similar to Intro to SharePoint + PowerShell (20)

PPTX
Spsatx slides (widescreen)
PPTX
Managing SharePoint Anywhere with Windows PowerShell
PPTX
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
PPTX
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
PPTX
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshop
PPTX
NZ Code Camp 2011 PowerShell + SharePoint
PPTX
Admin SharePoint 2010 with PowerShell
PPTX
PowerShellForDBDevelopers
PPTX
PowerShell for the Anxious ITPro
PPTX
Intro to PowerShell
PDF
PowerShell Introduction to Administering SharePoint On-Premises & O365
PPTX
Making Life Easier with PowerShell (SPSVB 2012)
PPTX
SharePoint Fundamentals (Lesson 1&2)
PDF
Mastering Office 365 with PowerShell - TechDays Finland 2020
PPTX
Using PowerShell for SharePoint 2013
PDF
Sql Server & PowerShell
PPTX
PowerShell Data as File System
PPTX
SPSDenver - SharePoint & jQuery - What I wish I would have known
PPTX
How to automate the SharePoint Provisioning
PDF
Spca2014 chris o brien modern share-point development - techniques for off-...
Spsatx slides (widescreen)
Managing SharePoint Anywhere with Windows PowerShell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshop
NZ Code Camp 2011 PowerShell + SharePoint
Admin SharePoint 2010 with PowerShell
PowerShellForDBDevelopers
PowerShell for the Anxious ITPro
Intro to PowerShell
PowerShell Introduction to Administering SharePoint On-Premises & O365
Making Life Easier with PowerShell (SPSVB 2012)
SharePoint Fundamentals (Lesson 1&2)
Mastering Office 365 with PowerShell - TechDays Finland 2020
Using PowerShell for SharePoint 2013
Sql Server & PowerShell
PowerShell Data as File System
SPSDenver - SharePoint & jQuery - What I wish I would have known
How to automate the SharePoint Provisioning
Spca2014 chris o brien modern share-point development - techniques for off-...

More from Ryan Dennis (14)

PPTX
Don't be afraid of moving infrastructure into Azure!
PPTX
Leave the fileshare, and join the enterprise content revolution!
PPTX
Leave the Fileshare, and join the Enterprise Content Revolution!
PPTX
Herding CATS: Gaining user adoption with these 4 principles
PPTX
Leave The Fileshare and join the Enterprise Content Revolution!
PPTX
SPSCBUS Slides Scarlet InfoPath
PPTX
Dogfood slides 2012
PPTX
ScarePoint Saturday Spookinnati Slides
PPTX
DAYSPUG - Funnel your info down a new path
PPTX
Build your SharePoint Internet Presence with PowerShell
PPTX
Funnel your Info down a new Path
PPTX
SPS Dayton Slides
PDF
SPS Cincinnati slidedeck (pdf)
PPTX
SPS Cincinnati slidedeck
Don't be afraid of moving infrastructure into Azure!
Leave the fileshare, and join the enterprise content revolution!
Leave the Fileshare, and join the Enterprise Content Revolution!
Herding CATS: Gaining user adoption with these 4 principles
Leave The Fileshare and join the Enterprise Content Revolution!
SPSCBUS Slides Scarlet InfoPath
Dogfood slides 2012
ScarePoint Saturday Spookinnati Slides
DAYSPUG - Funnel your info down a new path
Build your SharePoint Internet Presence with PowerShell
Funnel your Info down a new Path
SPS Dayton Slides
SPS Cincinnati slidedeck (pdf)
SPS Cincinnati slidedeck

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Modernizing your data center with Dell and AMD
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Big Data Technologies - Introduction.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Cloud computing and distributed systems.
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
cuic standard and advanced reporting.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Modernizing your data center with Dell and AMD
Advanced methodologies resolving dimensionality complications for autism neur...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Big Data Technologies - Introduction.pptx
NewMind AI Weekly Chronicles - August'25 Week I
NewMind AI Monthly Chronicles - July 2025
Dropbox Q2 2025 Financial Results & Investor Presentation
MYSQL Presentation for SQL database connectivity
Cloud computing and distributed systems.
Spectral efficient network and resource selection model in 5G networks
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Building Integrated photovoltaic BIPV_UPV.pdf
Network Security Unit 5.pdf for BCA BBA.
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
CIFDAQ's Market Insight: SEC Turns Pro Crypto
“AI and Expert System Decision Support & Business Intelligence Systems”

Intro to SharePoint + PowerShell

  • 1. Getting Started with SharePoint + PowerShell Ryan Dennis @SharePointRyan www.SharePointRyan.com
  • 2. Learn PowerShell. 24/7, Anywhere. Enter POWERSAT at checkout to save $50 on any training course. www.TRAINSIGNAL.com
  • 3. SeeShell Simple and Effective Data Visualization For PowerShell Use Coupon Code PSSAT002 And save 20% http://www.codeowls.com/seeshell
  • 4. About The Speaker Ryan Dennis, MCTS, MCPD, MCITP Senior SharePoint Engineer @ ICC Microsoft Virtual Technology Specialist (vTSP) www.SharePointRyan.com @SharePointRyan linkedin.com/in/sharepointryan ryan@sharepointryan.com
  • 5. Windows PowerShell …is a task-based command-line shell and scripting language designed especially for Windows system administration …has a task-based scripting language …includes powerful object manipulation capabilities …is built on the .NET Framework
  • 6. Verb-Noun PowerShell uses a Verb-Noun syntax for its Cmdlets • Get-Something • Set-Something • New-Something • Remove-Something
  • 7. Get-Command & Get-Help • While you can do a lot of the same things as the typical command prompt, use Get- Command to see available commands • Use Get-Help <cmdlet> to get help information for a cmdlet
  • 8. Using PowerShell Profiles • PowerShell uses 2 profiles, a user specific profile and a machine-wide profile… • Use profiles to pre-load scripts, functions, environmental variables, shell settings, aliases, etc.
  • 9. Script Editors & Tools • Notepad.exe (Lame) • Notepad++ (Less Lame) • Windows PowerShell ISE (Pretty Good - includes IntelliSense, Syntax highlighting) • Quest PowerGUI (Awesome – Adds advanced debugging, and other cool things – don’t worry, I’ll show you!) • Others…
  • 10. SharePoint 2010 Cmdlets • 500+ Cmdlets… • MUCH better than STSADM.exe… • Can automate complete installations and configurations… • Still doesn’t answer every scenario, leaving gaps in functionality… – Example: Get, New and Remove SharePoint Groups – no cmdlet, easy to write a custom function though…
  • 11. Creating a SharePoint Web Application using out-of-the-box PowerShell Cmdlets DEMONSTRATION
  • 12. Demo Recap • Used New-SPWebApplication to create a new SharePoint Web Application… • Stored the SPWebApplication object into the $webapp variable • Used Get-Member to view Methods and Properties associated with the Web Application
  • 13. Creating a SharePoint Site Collection using out-of-the-box PowerShell Cmdlets DEMONSTRATION TWO
  • 14. Demo Recap • Used New-SPSite to create a new SharePoint Site Collection… • Stored the SPSite object into the $site variable • Created a $web variable from $site.rootweb • Used the $web variable to change the Site Title using the SP Object Model • Used Get-History and Pipeline to create a simple script from our command history… • Cool right, but what if we could make this reusable???  (Hint: we can)
  • 15. Extending PowerShell with Scripts and Functions • PowerShell Scripts have .ps1 file extension… • Scripts and functions behave similarly if not identically, but functions are more reusable… • Scripts can reference functions and cmdlets… • Functions can include other functions within them and can also reference cmdlets…
  • 16. Using what we already learned and making it better. DEMONSTRATION THREE
  • 17. Demo Recap • Used the following cmdlets in conjunction with the pipeline to automagically build a function based on what we did in our first demonstration: – Get-History – Select-Object – Out-File • Used Quest PowerGUI to edit our function by adding Parameters, eliminating hard-coded values… • Added comment-based help from PowerGUI Snippet… • Tried out our cool, new function…
  • 18. The Power IS in the Shell, Use it Wisely! • PowerShell is VERY powerful, be aware of memory issues... • Use dispose() method for Site and Web objects, or better yet… • Use Start-SPAssignment –Global to capture all objects in the Global store, then use Stop-SPAssignment –Global to dispose of all objects…
  • 19. Get-Resources 1. TechNet for general PowerShell information… 2. The Hey, Scripting Guy! blog 3. Get-SPScripts.com 4. Gary Lapointe 5. Get-Help in a PowerShell window… 6. SharePointRyan.com (yes, my blog)…
  • 20. Got-Questions -? Ryan Dennis, MCTS, MCPD, MCITP Senior SharePoint Engineer @ ICC Microsoft Virtual Technology Specialist (vTSP) www.SharePointRyan.com @SharePointRyan linkedin.com/in/sharepointryan ryan@sharepointryan.com

Editor's Notes

  • #3: Please add the sponsor LOGO (if it exists), name, short description and any urls if necessary to the designated areas. CITPG will add the sponsor level.
  • #12: Start from a new PowerShell Window:Create a Site Collection:$site = New-SPSite –Url http://sps.adventureworks.com –Template “CMSPUBLISHING#0” –Name “SharePoint Saturday Cincinnati” –OwnerAlias isg1085\\spfarm –SecondaryOwnerAlias isg1085\\sharepointryan –Verbose$site | gm$web = $site.rootweb$web.title = “Modified”$web.update()Get-History | Out-File c:\\scriptsguatda.com/cmx.p\\demo.ps1
  • #14: Start from a new PowerShell Window:Create a Site Collection:$site = New-SPSite –Url http://sps.adventureworks.com –Template “CMSPUBLISHING#0” –Name “SharePoint Saturday Cincinnati” –OwnerAlias isg1085\\spfarm –SecondaryOwnerAlias isg1085\\sharepointryan –Verbose$site | gm$web = $site.rootweb$web.title = “Modified”$web.update()Get-History | Out-File c:\\scriptsguatda.com/cmx.p\\demo.ps1
  • #17: Create a script first, then talk about making it reusable by adding parameters and making it a functionCreate a dummy function on the shell to show how they work, then move into PowerGUIAdd some output with Write-HostAdd comment-based help