Power shell basics in sharepoint 2010 - SharePoint Saturday Houston 2010


Published on

Slides from the talk with Corey Roth and Kyle Kelin on PowerShell in SharePoint 2010.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Borrowed from SharePoint 2010 Ignite Developer 01 - Roadmap.
  • Demo some basic PowerShell commands.AliasesGet-ProcessGet-Process | Where-Object {$_.ProcessName –like “w3*”}Get-Process | Where-Object {$_.ProcessName –like “w3*”} | Format-List ProcessName, IdGet-Process | Where-Object {$_.ProcessName –like “w3*”} | Convertto-Html > Test.htmlGet-Help Get-Process (or some other command)New-SPWeb -URL http://sp2010/NewSite1 -Template STS#0 -Name "New Site"
  • Add-PSSnapinMicrosoft.SharePoint.PowerShellGet-Command –PSSnapinMicrosoft.SharePoint.PowerShellGet-Command –PSSnapinMicrosoft.SharePoint.PowerShell| Format-ListRedirected output (>)Get-SPSiteNew-SPSiteNew-SPWeb
  • Show C:Code1_RoadmapPowershellHello.ps1GetSharePointDlls.ps1CreateContosoSite.ps1
  • Demo Get-SPHelloWorldDemo Set-SPTitle
  • Power shell basics in sharepoint 2010 - SharePoint Saturday Houston 2010

    1. 1. PowerShell Basics in SharePoint 2010<br />Just enough to be dangerous<br />Corey Roth<br />Stonebridge<br />Twitter: @coreyroth<br />Blog: www.dotnetmafia.com<br />Kyle Kelin<br />Infusion<br />Twitter: @spkyle<br />Blog: www.dotnetmafia.com<br />
    2. 2. Welcome to Houston SharePoint Saturday<br />Thank you for being a part of the first ever SharePoint Saturday for the greater Houston area!<br />Please turn off all electronic devices or set them to vibrate.<br />If you must take a phone call, please do so in the hall so as not to disturb others.<br />Thanks to our Platinum Sponsors:<br />
    3. 3. Corey Roth<br />Consultant for Stonebridge in Tulsa, OK<br />Worked in Consumer Electronics, Travel, Advertising, and Energy industries<br />Currently doing SharePoint development specializing in Enterprise Search<br />Microsoft Solutions Advocate<br />Microsoft Award for Customer Excellence (ACE) Winner<br />E-mail: coreyroth@gmail.com<br />Twitter: @coreyroth<br />Blog: www.dotnetmafia.com<br />
    4. 4. Kyle Kelin<br />Principal Architect at Infusion<br />Built applications across multiple industries that include consumer electronics, travel, energy, government, pharmaceuticals, and investment banking<br />E-mail: kkelin@infusion.com<br />Twitter: @spkyle<br />Blog: www.dotnetmafia.com<br />
    5. 5. What is PowerShell?<br />
    6. 6. Like a command prompt…<br />Only better!<br />Aliases allow familiar MS-DOS and Unix commands to work (i.e.: dir, ls, cd, del)<br />Includes formatting features to display results as lists and tables<br />Pipelining allows results of one command to act as input to another<br />
    7. 7. What about STSADM?<br />Still present, but why use it?<br />Old scripts should run<br />STSADM extensions considered deprecated (but they’ll probably work)<br />
    8. 8. PowerShell Window<br />
    9. 9. Demo<br />
    10. 10. PS is perfect for SP<br />SharePoint functionality provided through Microsoft.SharePoint.PowerShellsnapin<br />Add-PSSnapinMicrosoft.SharePoint.PowerShell<br />Over 500 commands available<br />Get-Command Microsoft.SharePoint.PowerShell<br />
    11. 11. Demo<br />
    12. 12. Execution Policy<br />By default, PowerShell does not allow scripts to run<br />Change policy with Set-ExecutionPoilicy<br />Policy Settings<br />Restricted (default) – scripts will not execute<br />Unrestricted – scripts can execute. Unsigned scripts will prompt user to execute<br />Bypass (developer mode) – scripts can execute, no user prompting to execute<br />
    13. 13. Demo<br />
    14. 14. Cmdlets<br />Extend PowerShell using Visual Studio<br />Can be executed in PowerShell as a snapin or module<br />
    15. 15. Demo<br />
    16. 16. Questions?<br />
    17. 17. Session Evaluation<br />Please complete and turn in your Session Evaluation Form so we can improve future events.<br />Presenter:<br />Corey Roth / Kyle Kelin<br />Session Name:<br />PowerShell Basics in SharePoint 2010<br />
    18. 18. Thanks to our Sponsors<br />
    19. 19. Thanks<br />Corey Roth<br />Stonebridge<br />Twitter: @coreyroth<br />Blog: www.dotnetmafia.com<br />Kyle Kelin<br />Infusion<br />Twitter: @spkyle<br />Blog: www.dotnetmafia.com<br />