The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
Introduction to PowerShell for SharePoint Admins and Developers
1. Online Conference
June 17th and 18th 2015
WWW.SPBIZCONF.COM
Introduction to PowerShell
For SharePoint Admins and Developers
2. WWW.SPBIZCONF.COM
Who is Michael Blumenthal?
• Technical Evangelist, PSC Group
• 20 years in IT Consulting
• 12 years with SharePoint
• 8 years with PowerShell
• Twitter: @MichaelBL
4. Online Conference
June 17th and 18th 2015
• It’s Easy to Get Started!1
• Learn the PowerShell Syntax2
• PowerShell + SharePoint3
• Real World Examples4
• More Resources5
14. WWW.SPBIZCONF.COM
Reading Symbols in Code
• (tal Guidance
• Moe, Larry, and }
• The universe started with
the Big !
• !Important
• A # of Bacon and # Browns
30. WWW.SPBIZCONF.COM
Using SharePoint Cmdlets in the ISE
O365:
Import-Module microsoft.online.sharepoint.Powershell
On Prem 2010+:
C:...14 or 15CONFIGPOWERSHELL
RegistrationSharePoint.ps1
2007:
[void][System.Reflection.Assembly]::
LoadWithPartialName("Microsoft.SharePoint")
37. WWW.SPBIZCONF.COM
Real World Examples
• Check the Farm Version
• Check Versioning on all document Libraries
• Create List Items
• Export Web App Properties to a file
• Bulk Site Creation
38. WWW.SPBIZCONF.COM
What’s your Farm Version?
PS C:UsersAdministrator> $(get-
SPFarm).BuildVersion
Major Minor Build Revision
----- ----- ----- --------
14 0 6109 5002
43. WWW.SPBIZCONF.COM
Practical Uses
• Bulk Create Sites1
• List Item CRUD2
•Create data for test cases3
• Associate Workflows with a List4
•Work across site collections5
• Deployment Scripting6
• Identify files that won’t upload7
44. WWW.SPBIZCONF.COM
More Practical Uses
• Sync Wep App Properties8
• Install SharePoint9
• Repeatably Manage Content10
• Update Field Definitions11
• Report on Security12
46. WWW.SPBIZCONF.COM
Audio Alerts
• Stick this at the end of your long running
script:
$Voice = new-object -com SAPI.SpVoice
$Voice.Speak(“Deployment is done!")
47. Online Conference
June 17th and 18th 2015
Site Definitions in V. Studio
• Not an answer by themselves
• Define site content
• Intended for reuse
– Mismatch to one time need
• CAML and PITA
• Harder: Making it data driven
• Change Site Def -> Recreate
Site
PowerShell & Excel & UI
• Well suited for one time “blow
in’s”
• Define the site template in the
UI or use standard
• Save as a template
– Even pub sites - sometimes
• PowerShell has easy loops
• Data driven from a CSV
• Changes -> Mod Scripts
48. WWW.SPBIZCONF.COM
The PowerShell Solution
• Read the list of sites from CSV
• Loop:
– Create Site
– Configure Site
• Turn on Features
• Set Master Pages, Welcome Page
• Hide Libraries, set versioning
• Adjust Navigation
– Add Lists, Libraries, Pages, Web parts, etc
• Loop again & again if needed – iterative!
54. WWW.SPBIZCONF.COM
Resources Summary
• Jeff Hicks
• Gary LaPointe
• Raymond Mitchell
• Todd Klindt
• POSHCODE.ORG
• get-spscripts.com
• Michaelblumenthal.me
• SPYam
• PowerShell Product Team
Blog
• TechNet Script Center
• PowerShell in Action by Bruce
Payette
• CodePlex: PSBBs (mine)
• CodePlex:SPInstaller
• Blog.BlumenthalIT.Net
• SharePointJack.com
55. Online Conference
June 17th and 18th 2015
• It’s Easy to Get Started!1
• Learn the PowerShell Syntax2
• PowerShell + SharePoint3
• Real World Examples4
• More Resources5
56. WWW.SPBIZCONF.COM
Please fill in my session feedback form available
from the ‘Session Resources’ tab
on my session window.
Why not join us in October at
Michael Blumenthal
Technical Solution Evangelist
PSC Group, LLC
• Contact me at:
• MBlumenthal@psclistens.com
• MichaelBlumenthal.me
• Twitter: @MichaelBL
• Yammer.com/SPYam
Editor's Notes
Every SharePoint Developer needs this!
Fast and Flexible
Great for Last Mile Problems. The MSFT standard for Scripting.
Who would like another tool in their toolbox, one that will help them with SharePoint, but also with many other things? How about the swiss army knife of tools?
It will make you a better developer or administrator!
Who here already has installed and PowerShell? Who’s using Server 2003? 2008?
Win 2008 – It’s an OS Feature – “servermanagercmd –install PowerShell”
One is SharePoint aware, the other isn’t!
begin with a $
Name that Language…
Similar to @variables in SQL, apparently also Ruby, PHP.
Arrays start at 0
Mention Aliases
Get-Member examples
Can you imagine trying to do this in unix or vbscript?
Get-Help about_flow_control
Mention that collections start at 0
Your mother doesn’t work here! You must clean up after yourself.
http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?PageType=4&ListId={72C1C85B-1D2D-4A4A-90DE-CA74A7808184}&pID=524
http://msdn.microsoft.com/en-us/library/ee557362.aspx
See Assignment collections - http://technet.microsoft.com/en-us/library/ff607664.aspx
Once used a choice column’s values instead of a CSV
Windows PowerShell in Action by Bruce Payette, V2
Since then Hicks and Jones have written some good books too
http://www.codeplex.com/psbb
Also:
PoshCode.Org
TechNet Script Center http://www.microsoft.com/technet/scriptcenter/default.mspx
MSDN SharePoint Developer Center http://msdn.microsoft.com/en-us/office/aa905503.aspx
Zach Rosenfield’s Blog - http://sharepoint.microsoft.com/blogs/zach/default.aspx
http://blog.falchionconsulting.com/
http://thepowershellguy.com/blogs/posh/pages/powertab.aspx
Who would like another tool in their toolbox, one that will help them with SharePoint, but also with many other things? How about the swiss army knife of tools?
It will make you a better developer or administrator!