Your SlideShare is downloading. ×
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Brian Jackett: Managing SharePoint 2010 Farms with Powershell

2,715
views

Published on


1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total Views
2,715
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
39
Comments
1
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Explain ICanHasCheeseburger.com and photos
  • Half presentation, half demos. Start out introduction to PowerShell, then get into SharePoint integration. Lots of slides, but move quickly through them.
  • Probably can align with 1 of these 3 categories. Try to cover content for everyone but focusing on the 100 level introductory content.
  • This is how I’m rating myself, hopefully these satisfy your goals as wellQuote adapted from Jeremiah Peschka, database application developer in Columbus, OH. Not sure if he borrowed from anyone.Will cover what a commandlet is later in presentation
  • Most stage performers and magicians have an assistant, so I have mine as well
  • Quick view of what PowerShell looks like. On left is a shot of my customized console screen after profile commands have run. Explain more later, but let’s me know if certain things are in place.
  • Show that Central Admin is aware when you run new PowerShell backups, go to restore page.
  • Transcript

    • 1. Managing SharePoint 2010
      Farms With PowerShell
      Brian T. Jackett
      Sogeti USA
      www.BrianTJackett.com
      @BrianTJackett
      Brian.Jackett@us.sogeti.com
    • 2. About Me
      • Senior Consultant at Sogeti USA
      • 3. Microsoft BI and Collaboration Lead
      • 4. Blogger
      • 5. Twitter’er
      • 6. PowerShell Enthusiast
      • 7. Central Ohio SPUG Steering Committee
      • 8. Frog lover
    • No naps scheduled after lunch, wha…?
    • 9. Agenda
    • Why Are You In This Talk?
      • Completely new to SharePoint administration
      • 15. Been using STSADM and need to learn PowerShell
      • 16. Been using PowerShell and want to use on SharePoint
      Little bit of content for everyone
    • 17. Quick Polls
      Is your role admin / developer / other?
      Have you used STSADM?
      Have you used PowerShell?
      • If yes, level of proficiency (low, medium, high)?
      Already working with SharePoint 2010?
    • 18. Goals for this presentation…
      • Learn the following mantra
      “If you have to write/click twice then script/automate it”
      • Basics of PowerShell (independent of SharePoint)
      • 19. Basic overview of SharePoint 2010 commandlets
    • My Assistants for the Afternoon
    • 20. Breaking Open PowerShell
    • 21. PowerShell Origins
      • Introduced in 2006
      • 22. Originally codename Monad
      • 23. Later renamed to Microsoft Shell (MSH)
      • 24. Later renamed again to Windows PowerShell
      • 25. Becoming a cornerstone tool for administration
      Exchange 2007
      SQL Server 2008
      … and now SharePoint 2010!!
      In 2010, your newest Swiss Army Knife in SP tool bag
    • 26. What Is PowerShell?
      PowerShell is…
      • A command line shell
      • 27. Object oriented
      Able to support .Net objects, not just text
      • Extensible
      • 28. New scripting language
      Aims to be familiar to those writing VBscript or shell scripting like Unix, but simplified like command line
    • 29. Screenshot Comparison to CMD
    • 30. Brief Features Overview
      • Consistent syntax
      Shame on STSADM
      • Object oriented pipeline
      Able to pass object output from one cmdlet as input to next
      Ex. Get-ChildItem | Sort-Object -Property LastWriteTime
      • Built-in providers
      Talk to Active Directory, registry, WMI, etc. natively
      • Aliases
      Bridge the gap for Unix, VBScript, etc. users
      • Tab complete
      • 31. Many more…
    • System Requirements
      Default installed on Windows 7 and Server 2008 R2
      Integrated Scripting Environment (ISE) optional role on Server 2008 R2
    • 32. How To Use
      Syntax
      • Verb-Noun –parameter “Parameter value”
      Ex. Set-Location –Path C:/
      • Variables
      $variable_name = command
      • Case insensitive
      http://www.youtube.com/watch?v=KyLqUf4cdwc
    • 33. How To Use
      Commandlets (or cmdlets)
      • Premade commands to handle basic functionality
      Ex. Get-Help; Invoke-Item; Write-Host
      • 400+ with V2
      Modules and snap-ins allow adding custom commandlets
      Scripts (.ps1)
      • Place commands into a script file for repeat use
    • How To Find Help
      Syntax
      • Get-Help [cmdlet [*]]
      • 34. Get-Alias [cmdlet [*]]
      • 35. (object) | Get-Member
      We’ll get to the pipe operator ‘|’ later
      • [] = optional
      • 36. () = object or variable
    • When to Use
      Use PowerShell when…
      • a process must be consistent
      • 37. a process must be performed for multiple workstations/users/etc
      • 38. you don’t know the target that needs to be modified
      “If you have to write it twice, script it”
    • 39. Security Considerations
      • By default, PowerShell is locked down to not run scripts
      Need to unlock with Set-ExecutionPolicy <level>
      6 levels of execution available
      Get-Help about_execution_policies
      • SharePoint requires permissions to run PowerShell
      Add-SPShellAdmin
      http://technet.microsoft.com/en-us/library/ee748614(office.14).aspx
    • 40. A Word about the Profile
      PowerShell Profile
      • Can pre-load aliases, shortcuts, variables, etc.
      • 41. Good place to load needed assemblies
      • 42. Accessed at $profile
      <docs>WindowsPowerShellMicrosoft.PowerShell_profile
      <docs>WindowsPowerShellMicrosoft.PowerShellise_profile
      Easy to create: “new-item –type file –path <path>”
    • 43. Enough Intro, Let’s Demo
    • 44. Demo 1
      Get-Help
      Get-Member
      Simple commands with file system
      Get-Alias
      Tab complete
    • 45. Power of the Pipe
    • 46. Power of the Pipe
      The Pipe Operator “|”
      • Output from one command becomes input for the next
      • 47. String together multiple commands
      Filtering Option
    • Demo 2
      Piping commands to each other
      Sort
      Select
      Where
    • 50. Our Protégé is Walking
    • 51. PowerShell Providers
      Able to natively talk to:
      Get-PSProvider & Get-PSDrive
    • 58. I know what you’re thinking…
      28 Slides and no demos about SharePoint yet…?!?
    • 59. Accessing the SharePoint API
      Microsoft.SharePoint.dll
      • SharePoint Object Model Hierarchy
      SPFarm
      SPWebApplication
      SPSite
      SPWeb
      SPList
      SPListItem
      • Know how to handle SPSite and SPWeb memory
      Start-SPAssignment –global
      Stop-SPAssignment
    • 60. Finally PowerShell + SharePoint
    • 61. Demo 3 – Site Hierarchy
      Access SharePoint Hierarchy
      Access object properties
      http://sharepoint.microsoft.com/blogs/zach/Lists/Posts/Post.aspx?ID=43
    • 62. SharePoint Backup
      • Script out a backup/restore procedure (STSADM)
      • 63. Remove old backups
      • 64. Determine size of largest backup
      • 65. Schedule PowerShell commands
      PowerShell -command "& 'MyScript.ps1' “
      Place into a .cmd or .bat and schedule as usual
      Can programmatically call script based on output from others
    • 66. SharePoint Backup
      • Script out a backup/restore procedure
      • 67. Remove old backups
      • 68. Determine size of largest backup
    • Scheduling PowerShell Scripts
      • Schedule PowerShell commands
      PowerShell -command "& 'MyScript.ps1' “
      Place into a .cmd or .bat and schedule as usual
      Can programmatically call script based on output from others
    • 69. Demo 4 - Backups
      Backup-SPSite
      Backup-SPFarm
      Get-SPBackupHistory
    • 70. SharePoint Site Administration
      Ideas to think about:
      • Activate/deactivate features
      • 71. Set/unset master pages
      • 72. Create/delete site
      • 73. Check file sizes on site
      • 74. Update list values
      • 75. …sky is the limit
    • Demo 5 – Interacting Sites
      Create site
      Delete site
      Recursively traverse site hierarchy
      Enumerate site templates
    • 76. Limit Server Results With –Filter Switch
      Typically you have this scenario
    • 77. Limit Server Results With –Filter Switch
      Using –Filter limits results coming back from server
    • 78. Demo 6 – Server Side Filter
      Filter SPWebs server side
    • 79. See How Fast This Shell Can Go
    • 80. Complex Scripts
      Multitask within one script
      • Reference site
      • 81. Recursively traverse site hierarchy
      • 82. Read SharePoint group membership
      • 83. Determine Active Directory groups
      • 84. Expand Active Directory groups to users
    • Demo 7 – Johnny 5 is Alive
      The laser show spectacular
    • 85. Who’s Brain is Full Now?
    • 86. New Features in V2
      PowerShell V2
      • PowerShell remoting
      • 87. Integrated Scripting Environment (ISE)
      • 88. Script debugging (breakpoints)
      • 89. Background jobs
      • 90. Modules
      • 91. Get-Help –online
    • V2 Release Schedule
      • Ships with Windows 7 and Server 2008 R2
      Automatically installed by default
      • Downloadable for XP/Server 2003 and above
      Released end of Oct 2009 as Windows Management Framework
    • 92. SharePoint 2010 Considerations
      PowerShell preferred command line tool over STSADM
      • STSADM is being depricated
      Means STSADM is supported, but start learning PowerShell
      • Over 500 cmdlets to integrate with SharePoint
      • 93. SharePoint Management Console = PowerShell
      • 94. Remoting allows administrate entire farm centrally
    • –Whatif and –Confirm clauses
      Appending “-whatif” to commandlet allows seeing potential outcome without executing
      Ex. Remove-SPWeb –urlhttp://site –whatif
      Appending “-confirm” prompts user for confirmation before executing
      Ex. Remove-SPWeb –urlhttp://site –confirm
    • 95. Conclusion
      • PowerShell is a new scripting admin tool
      • 96. Syntax and how to use
      • 97. Basic demos for file system and SharePoint
      • 98. Hopefully had a few laughs as well
    • References
      PowerShell Product Homepage
      http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx
      PowerShell Script Center
      http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
      PowerShell Owner’s Manual (good intro walkthroughs)
      http://www.microsoft.com/technet/scriptcenter/topics/winpsh/manual/default.mspx
      PowerShell Community
      http://powershellcommunity.org
      PowerShell and SharePoint 2010
      http://stsadm.blogspot.com/2009/10/sharepoint-2010-stsadm-and-powershell.html
    • 99. Q&A
    • 100. Thank you for attending!
    • 101. 2 ASUS Netbooks
      Also Some Books
      1 Typemock Isolator License
      A 2-5 Day Course from SetFocus on SharePoint
      Telerik RAD Controls Set
      1 DeliverPointWFE 2010 license (Worth $1500)
      1 BCS Meta Man license (Worth $1200)
      1 Lightning Conductor 2010 WFE license (Worth $800)
      1 Lightning Storm Forums license. (Worth $600)

    ×