SlideShare a Scribd company logo
Managing SharePoint Anywhere with 
Windows PowerShell 
Ryan Dennis
Ryan Dennis 
Senior SharePoint Consultant at Blue Chip Consulting Group 
Recently published first book as a co-author 
SP Geek Father 
www.bluechip-llc.com Drummer Husband 
ryan.dennis@bluechip-llc.com 
@SharePointRyan 
/in/SharePointRyan 
Dog Lover Author 
/SharePointRyanDotCom 
www.sharepointryan.com 
http://bit.ly/MMS13book
Archie the Corgi
Ask Our Experts! 
• Visit the Blue Chip booth to 
chat with one of our Expert 
Consultants 
• Drop us your business card, 
and we’ll help you solve your 
business problem and you 
might win an XBOX One** 
• Our resident SharePoint 
MCM/MVP is here all day, 
Monday & Tuesday* 
• Visit our other sessions in 
the SharePoint & PowerShell 
tracks! 
*Except when presenting 
**Drawing Tuesday. 
Blue Chip Featured Expert 
Paul Stork 
@PStork 
Paul is a Microsoft 
SharePoint MVP and 
MCM who works as 
Principal Architect at Blue Chip 
Consulting Group. An author and/or 
contributor on several SharePoint books, 
Paul is a well-known contributor to the 
SharePoint community.
Get-Agenda 
• Housekeeping 
• Intro to Advanced Functions 
• SharePoint PowerShell On-Premise 
• SharePoint PowerShell in Office 365 
• Using Client Side Object Model (CSOM) 
code in PowerShell 
• Q&A
Get-Help –Topic “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 
Quick Tip! 
Use Get-Verb to find 
approved verbs! Use 
Verb-Noun in your code!
Get-Command & Get-Help 
• Use Get-Command to see available 
commands 
Get-Command –Module 
Microsoft.SharePoint.PowerShell 
Get-Command –Module 
Microsoft.Online.SharePoint.PowerShell 
• Use Get-Help <CmdletName> to get 
help information for a cmdlet 
Quick Tip! 
Add Help to your 
scripts and 
functions!
Get-Command –Type “SharePoint” 
• SharePoint 2010 
– 500+ Cmdlets… 
– MUCH better than STSADM.exe in prior versions… 
– Can automate complete installations and 
configurations… 
• SharePoint 2013 
– 700+ Cmdlets! 
• 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… 
Opportunity! 
Write our own scripts 
and functions!
Get-Help About_Functions_Advanced 
…allow you to perform operations that are 
similar to the operations you can perform 
with cmdlets 
…quickly write a function without having to 
write a compiled cmdlet using a Microsoft 
.NET Framework language (C#) 
…use the CmdletBinding() attribute to 
identify them as functions that act similar to 
cmdlets 
Quick Tip! 
Use Get-Help 
About_Functions_Advanced 
for more info!
New-Function –Name “Our First Function” 
• Leverages all of the Write-* cmdlets in the 
Microsoft.PowerShell.Utility module 
• Includes Switch statement, ValidateSet, 
Try/Catch/Finally, etc. 
• Includes comment-based-help with 
examples 
• Can be run just like a cmdlet 
Disclaimer! 
This is NOT a SharePoint 
demo, just a general 
PowerShell demo!
D E M O 
Write-Message
Get-Recap 
• Reviewed Write-Message function… 
• Created output using all Write* types 
• Saw the behavior of –Verbose and –Debug 
switches 
• Had some fun…
Get-Info “SP PowerShell On-Premises” 
• Uses the Microsoft.SharePoint.PowerShell 
snap-in 
• Access to hundreds* of native cmdlets 
• Script using Server Side Object Model 
Code 
• Run as default (administrative) user 
• Must have server access 
*782 cmdlets on my 
SP 2013 April 2014 
CU farm.
Get-Info “SP PowerShell O365” 
• Uses the 
Microsoft.Online.SharePoint.PowerShell 
module 
• Access to thirty* (30) native cmdlets 
• Script using Client Side Object Model 
Code 
• Provide user credentials for ClientContext 
• No need for server access 
*30 cmdlets as of 
9/19/2014.
Get-Started -with “SP Online Scripting” 
• Download the SharePoint Online 
Management Shell 
• Use Connect-SPOService to connect to 
your Tenant SharePoint Administration 
Site 
• Use Get-Command –Module 
Microsoft.Online.SharePoint.PowerShell to 
see the available cmdlets
Get-Intro –Topic “SharePoint CSOM” 
• Add the following Assemblies 
– Microsoft.SharePoint.Client.dll 
– Microsoft.SharePoint.Client.Runtime.dll 
• Create a ClientContext variable 
• Call the Load() and ExecuteQuery() 
methods 
• Once context is created, get and set 
properties… For help on writing 
CSOM, see 
http://bit.ly/MsdnCsom
D E M O 
SharePoint Online
Get-Recap 
• Loaded assemblies using: 
Import-SPOAssemblies 
• Created context using 
New-SPOServiceContext 
• Created a new Site using 
New-SPOWeb 
• Retrieved Web using 
Get-SPOWeb 
• Set Properties with 
Set-SPOWebProperties 
Important! 
All of these 
functions/commands 
are a part of our 
custom PowerShell 
Module! Not OOTB.
Get-Info –Type “Bonus” 
• All of this works on-premises as well… 
– Just need to create ClientContext() differently 
• Use the System.Net.NetworkCredential object instead of 
Microsoft.SharePoint.Client.SharePointOnlineCredentials 
• It is security trimmed, if you don’t have SP 
permissions to do this – you can’t… 
• CSOM != SSOM 
– You do not have access to all of the same 
methods and properties…
Q U E S T I O N S ?
Ryan Dennis 
Senior SharePoint Consultant at Blue Chip Consulting Group 
Recently published first book as a co-author 
SP Geek Father 
www.bluechip-llc.com 
Drummer Husband ryan.dennis@bluechip-llc.com 
@SharePointRyan 
/in/SharePointRyan 
Dog Lover Author 
/SharePointRyanDotCom 
www.sharepointryan.com 
http://bit.ly/MMS13book

More Related Content

PPTX
SharePoint Saturday Cincinnati 2014 - CSOM
PPTX
SharePoint PowerShell for the Admin and Developer - A Venn Diagram Experience
PPTX
Iconus 2016
PDF
SPSNJ 2014: EmberJS & SharePoint
KEY
Capybara-Webkit
PDF
Ember and SharePoint
PPTX
Writing power shell the right tool for the job
PDF
Automating everything with Microsoft Flow
SharePoint Saturday Cincinnati 2014 - CSOM
SharePoint PowerShell for the Admin and Developer - A Venn Diagram Experience
Iconus 2016
SPSNJ 2014: EmberJS & SharePoint
Capybara-Webkit
Ember and SharePoint
Writing power shell the right tool for the job
Automating everything with Microsoft Flow

What's hot (20)

PPTX
Localizing SharePoint: Adding Multi-language Support to Your Site
PPTX
SharePoint Development 101
PPTX
Custom Applications - What, When, and Why
PDF
Automate yourself out of a job - Use ChatOps!
PPTX
Why & How to Create a WordPress Plugin
PPTX
Untangling - fall2017 - week 9
PDF
Engage 2019: Modernising Your Domino and XPages Applications
PDF
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
PPTX
SenchaCon 2016: Being Productive with the New Sencha Fiddle - Mitchell Simoens
PPTX
Dev traning 2016 symfony
PPTX
The future of web development write once, run everywhere with angular.js and ...
PDF
Selenium testing
PDF
Hello world - intro to node js
PDF
This is presentation at Mitaka.rb #10.
PDF
Azure web functions little bites of services
PPTX
Untangling - fall2017 - week 7
PPTX
Catch 22: FLex APps
PDF
Adobe AEM for Business Heads
PPTX
Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...
PDF
One Neos CMS - many websites
Localizing SharePoint: Adding Multi-language Support to Your Site
SharePoint Development 101
Custom Applications - What, When, and Why
Automate yourself out of a job - Use ChatOps!
Why & How to Create a WordPress Plugin
Untangling - fall2017 - week 9
Engage 2019: Modernising Your Domino and XPages Applications
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
SenchaCon 2016: Being Productive with the New Sencha Fiddle - Mitchell Simoens
Dev traning 2016 symfony
The future of web development write once, run everywhere with angular.js and ...
Selenium testing
Hello world - intro to node js
This is presentation at Mitaka.rb #10.
Azure web functions little bites of services
Untangling - fall2017 - week 7
Catch 22: FLex APps
Adobe AEM for Business Heads
Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...
One Neos CMS - many websites
Ad

Viewers also liked (14)

PDF
Presentatie Dominiek Callewier
PDF
SPS Cincinnati slidedeck (pdf)
PPTX
SPS Cincinnati slidedeck
PPS
Werken R8 Agentschap Wegen en Verkeer
PPTX
Intro to SharePoint + PowerShell
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
Funnel your Info down a new Path
PPTX
Leave the fileshare, and join the enterprise content revolution!
PPTX
20120606 Studenten Howest Brugge Strategie BPKN
PPTX
20121115 hulpverleningszone fluvia
PPTX
Groepsaankoop energie &rsquo;groot&rsquo; verbruik
PPTX
Hoe gaan we te werk bij groepsaankoop energie?
Presentatie Dominiek Callewier
SPS Cincinnati slidedeck (pdf)
SPS Cincinnati slidedeck
Werken R8 Agentschap Wegen en Verkeer
Intro to SharePoint + PowerShell
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
Funnel your Info down a new Path
Leave the fileshare, and join the enterprise content revolution!
20120606 Studenten Howest Brugge Strategie BPKN
20121115 hulpverleningszone fluvia
Groepsaankoop energie &rsquo;groot&rsquo; verbruik
Hoe gaan we te werk bij groepsaankoop energie?
Ad

Similar to Managing SharePoint Anywhere with Windows PowerShell (20)

PPTX
Spsatx slides (widescreen)
PPTX
PowerShell for the Anxious ITPro
PPTX
Power shell for sp admins
PPTX
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshop
PPTX
Using PowerShell for SharePoint 2013
PPTX
Basic PowerShell Toolmaking - Spiceworld 2016 session
PDF
I6 - State of the art SharePoint PowerShell Nation 2017 - Spencer Harbar
PPTX
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
PPTX
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
PPTX
Introduction to PowerShell for SharePoint Admins and Developers
PPTX
Learn from my Mistakes - Building Better Solutions in SPFx
PPTX
PowerShell Basics for Office Apps and Servers
PPTX
Release Management with Visual Studio Team Services and Office Dev PnP
PPTX
Introduction to Office Development Topics
PPTX
My first powershell script
PPTX
PowerShellForDBDevelopers
PPTX
PowerShell - Be A Cool Blue Kid
PDF
PowerShell Introduction to Administering SharePoint On-Premises & O365
PPTX
PowerShell for SharePoint Admins
PDF
powershell.pdf
Spsatx slides (widescreen)
PowerShell for the Anxious ITPro
Power shell for sp admins
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshop
Using PowerShell for SharePoint 2013
Basic PowerShell Toolmaking - Spiceworld 2016 session
I6 - State of the art SharePoint PowerShell Nation 2017 - Spencer Harbar
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Introduction to PowerShell for SharePoint Admins and Developers
Learn from my Mistakes - Building Better Solutions in SPFx
PowerShell Basics for Office Apps and Servers
Release Management with Visual Studio Team Services and Office Dev PnP
Introduction to Office Development Topics
My first powershell script
PowerShellForDBDevelopers
PowerShell - Be A Cool Blue Kid
PowerShell Introduction to Administering SharePoint On-Premises & O365
PowerShell for SharePoint Admins
powershell.pdf

More from Ryan Dennis (7)

PPTX
Don't be afraid of moving infrastructure into Azure!
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
SPS Dayton Slides
Don't be afraid of moving infrastructure into Azure!
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
SPS Dayton Slides

Recently uploaded (20)

PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
A review of recent deep learning applications in wood surface defect identifi...
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
Hybrid model detection and classification of lung cancer
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
WOOl fibre morphology and structure.pdf for textiles
PPT
Geologic Time for studying geology for geologist
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
STKI Israel Market Study 2025 version august
PPTX
Tartificialntelligence_presentation.pptx
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PPTX
Chapter 5: Probability Theory and Statistics
PPT
What is a Computer? Input Devices /output devices
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PPTX
Web Crawler for Trend Tracking Gen Z Insights.pptx
PDF
Architecture types and enterprise applications.pdf
Final SEM Unit 1 for mit wpu at pune .pptx
A review of recent deep learning applications in wood surface defect identifi...
Group 1 Presentation -Planning and Decision Making .pptx
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
Hybrid model detection and classification of lung cancer
observCloud-Native Containerability and monitoring.pptx
WOOl fibre morphology and structure.pdf for textiles
Geologic Time for studying geology for geologist
Getting started with AI Agents and Multi-Agent Systems
STKI Israel Market Study 2025 version august
Tartificialntelligence_presentation.pptx
Taming the Chaos: How to Turn Unstructured Data into Decisions
Chapter 5: Probability Theory and Statistics
What is a Computer? Input Devices /output devices
Module 1.ppt Iot fundamentals and Architecture
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Web Crawler for Trend Tracking Gen Z Insights.pptx
Architecture types and enterprise applications.pdf

Managing SharePoint Anywhere with Windows PowerShell

  • 1. Managing SharePoint Anywhere with Windows PowerShell Ryan Dennis
  • 2. Ryan Dennis Senior SharePoint Consultant at Blue Chip Consulting Group Recently published first book as a co-author SP Geek Father www.bluechip-llc.com Drummer Husband [email protected] @SharePointRyan /in/SharePointRyan Dog Lover Author /SharePointRyanDotCom www.sharepointryan.com http://bit.ly/MMS13book
  • 4. Ask Our Experts! • Visit the Blue Chip booth to chat with one of our Expert Consultants • Drop us your business card, and we’ll help you solve your business problem and you might win an XBOX One** • Our resident SharePoint MCM/MVP is here all day, Monday & Tuesday* • Visit our other sessions in the SharePoint & PowerShell tracks! *Except when presenting **Drawing Tuesday. Blue Chip Featured Expert Paul Stork @PStork Paul is a Microsoft SharePoint MVP and MCM who works as Principal Architect at Blue Chip Consulting Group. An author and/or contributor on several SharePoint books, Paul is a well-known contributor to the SharePoint community.
  • 5. Get-Agenda • Housekeeping • Intro to Advanced Functions • SharePoint PowerShell On-Premise • SharePoint PowerShell in Office 365 • Using Client Side Object Model (CSOM) code in PowerShell • Q&A
  • 6. Get-Help –Topic “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
  • 7. Verb-Noun PowerShell uses a Verb-Noun syntax for its Cmdlets • Get-Something • Set-Something • New-Something • Remove-Something Quick Tip! Use Get-Verb to find approved verbs! Use Verb-Noun in your code!
  • 8. Get-Command & Get-Help • Use Get-Command to see available commands Get-Command –Module Microsoft.SharePoint.PowerShell Get-Command –Module Microsoft.Online.SharePoint.PowerShell • Use Get-Help <CmdletName> to get help information for a cmdlet Quick Tip! Add Help to your scripts and functions!
  • 9. Get-Command –Type “SharePoint” • SharePoint 2010 – 500+ Cmdlets… – MUCH better than STSADM.exe in prior versions… – Can automate complete installations and configurations… • SharePoint 2013 – 700+ Cmdlets! • 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… Opportunity! Write our own scripts and functions!
  • 10. Get-Help About_Functions_Advanced …allow you to perform operations that are similar to the operations you can perform with cmdlets …quickly write a function without having to write a compiled cmdlet using a Microsoft .NET Framework language (C#) …use the CmdletBinding() attribute to identify them as functions that act similar to cmdlets Quick Tip! Use Get-Help About_Functions_Advanced for more info!
  • 11. New-Function –Name “Our First Function” • Leverages all of the Write-* cmdlets in the Microsoft.PowerShell.Utility module • Includes Switch statement, ValidateSet, Try/Catch/Finally, etc. • Includes comment-based-help with examples • Can be run just like a cmdlet Disclaimer! This is NOT a SharePoint demo, just a general PowerShell demo!
  • 12. D E M O Write-Message
  • 13. Get-Recap • Reviewed Write-Message function… • Created output using all Write* types • Saw the behavior of –Verbose and –Debug switches • Had some fun…
  • 14. Get-Info “SP PowerShell On-Premises” • Uses the Microsoft.SharePoint.PowerShell snap-in • Access to hundreds* of native cmdlets • Script using Server Side Object Model Code • Run as default (administrative) user • Must have server access *782 cmdlets on my SP 2013 April 2014 CU farm.
  • 15. Get-Info “SP PowerShell O365” • Uses the Microsoft.Online.SharePoint.PowerShell module • Access to thirty* (30) native cmdlets • Script using Client Side Object Model Code • Provide user credentials for ClientContext • No need for server access *30 cmdlets as of 9/19/2014.
  • 16. Get-Started -with “SP Online Scripting” • Download the SharePoint Online Management Shell • Use Connect-SPOService to connect to your Tenant SharePoint Administration Site • Use Get-Command –Module Microsoft.Online.SharePoint.PowerShell to see the available cmdlets
  • 17. Get-Intro –Topic “SharePoint CSOM” • Add the following Assemblies – Microsoft.SharePoint.Client.dll – Microsoft.SharePoint.Client.Runtime.dll • Create a ClientContext variable • Call the Load() and ExecuteQuery() methods • Once context is created, get and set properties… For help on writing CSOM, see http://bit.ly/MsdnCsom
  • 18. D E M O SharePoint Online
  • 19. Get-Recap • Loaded assemblies using: Import-SPOAssemblies • Created context using New-SPOServiceContext • Created a new Site using New-SPOWeb • Retrieved Web using Get-SPOWeb • Set Properties with Set-SPOWebProperties Important! All of these functions/commands are a part of our custom PowerShell Module! Not OOTB.
  • 20. Get-Info –Type “Bonus” • All of this works on-premises as well… – Just need to create ClientContext() differently • Use the System.Net.NetworkCredential object instead of Microsoft.SharePoint.Client.SharePointOnlineCredentials • It is security trimmed, if you don’t have SP permissions to do this – you can’t… • CSOM != SSOM – You do not have access to all of the same methods and properties…
  • 21. Q U E S T I O N S ?
  • 22. Ryan Dennis Senior SharePoint Consultant at Blue Chip Consulting Group Recently published first book as a co-author SP Geek Father www.bluechip-llc.com Drummer Husband [email protected] @SharePointRyan /in/SharePointRyan Dog Lover Author /SharePointRyanDotCom www.sharepointryan.com http://bit.ly/MMS13book

Editor's Notes

  • #13: Go to the BI Center Excel Services Visio Services
  • #19: Go to the BI Center Excel Services Visio Services
  • #22: -Show an existing discussion with multiple replies -Create a new discussion -