1 / 86

PowerShell for SharePoint Developers and Administrators

PowerShell for SharePoint Developers and Administrators . Michael Blumenthal Magenic Technologies MichaelBl@Magenic.com. Who is Michael Blumenthal?. Sr. Consultant @ Magenic (MSFT Gold Partner) 16 years in IT Consulting 8 years working with SharePoint

toki
Télécharger la présentation

PowerShell for SharePoint Developers and Administrators

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PowerShell for SharePoint Developers and Administrators Michael Blumenthal Magenic Technologies MichaelBl@Magenic.com

  2. Who is Michael Blumenthal? • Sr. Consultant @ Magenic (MSFT Gold Partner) • 16 years in IT Consulting • 8 years working with SharePoint • MCITP: SharePoint 2010; MCTS: WSS Dev • MCTS: MOSS Config & MCTS: WSS Config • MCAD, MCSE, MCDBA, CAPM

  3. Why PowerShell?

  4. PowerShell puts the SharePoint Engine at your fingertips!

  5. Chapter 1 It’s Easy to get Started!

  6. Getting Started with PowerShell

  7. Shell User Experience >>

  8. Chapter 2 Learn the PowerShell Syntax!

  9. Learn to use PowerShell with SharePoint!

  10. Symbols, Keywords, and Syntax! Oh My!

  11. Punctuation Pronunciation Is “$#|” a “one dollar hash pipe”?

  12. 1 Variables begin with a $

  13. Commands are called cmdlets. • 2

  14. The Power of Piping! • 3 |

  15. Example

  16. Making Comparisons • 4

  17. Taking Control of the Flow • 5

  18. Example

  19. Where-Object • 6

  20. Using the SharePoint API

  21. Highlights from the SharePoint Object Model SPSite

  22. Loading SharePoint DLLs [void][System.Reflection.Assembly]:: LoadWithPartialName("Microsoft.SharePoint")

  23. Get a Site and Explore it! $site = New-Object Microsoft.SharePoint.SPSite(“http://server/path”) OR $site = Get-SPSite(“http://server/path”) THEN $site

  24. Create a List Item

  25. Practical Uses

  26. A Word About Memory Management Dispose

  27. Creating .PS1 Script Files

  28. Executing Scripts

  29. Chapter 3 Real World Examples

  30. Real World Examples • Check the Version • Check Versioning on all document Libraries • Clear a list • Look at multiple Event Throttling levels at once for the ULS (diagnostic) log

  31. What’s your MOSS Version? $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local $farm.BuildVersion Major  Minor  Build  Revision -----  -----  -----  -------- 12     0      0      6318

  32. Check Doc Lib Versioning Settings function global:show-all-doclibs ($web) {$web.Lists | where-object {($_.Hidden -ne $true) -and ($_.BaseType -eq "DocumentLibrary")} } function global:show-all-doclib-versettings ($web) {show-all-doclibs ($web) |select-object -property Title, EnableVersioning, MajorVersionLimit, EnableMinorVersions,MajorWithMinorVersionsLimit,forceCheckout} $site = get-spsite “http://server/path” show-all-doclib-versettings $site.RootWeb

  33. Clear a List • Make a mess: • Clean it up!

  34. Look at the ULS configuration • Why? • See multiple event categories at once! • How? • $ulsid = $farm.Services | select-object TypeName, Id | where {$_.TypeName -eq "Windows SharePoint Diagnostics Service"} | Select-Object Id • $ulsvc = $farm.GetObject($ulsid.Id.ToString()) • $ulsvc.GetItems() | Select-Object Name, EventSeverity, TraceSeverity, hidden | where {$_.hidden -eq 0}

  35. Chapter 4 More Resources

  36. Resources

  37. Use a Decompiler to see MSFT’s Code! OR ILSpy.net dotPeek (jetbrains) justDecompile (Telerik) Others… No Longer Free

More Related