Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited...
Transcript of Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited...
Stop Clicking Your Mouse Button! We Can Script ThatMaking your day to day more efficient with PowerShell
SPSVancouver Sponsors
David Drever
• SharePoint Services Lead
• Microsoft Office Servers and Services MVP
• SharePoint JoAT (Jack of All Trades)
• Leadership team member Saskatchewan
SharePoint Office365 User Group
(https://www.meetup.com/SKSPOUG/)
Email : [email protected]
Twitter : @DavidMDrever
Website: http://solvera.ca
Blog: http://prairiedeveloper.com
Contact Details:
Solvera Solutions
Topics We are Covering Today
A “30,000 Foot View” of PowerShell
A “30,000 Foot View” of PowerShell
A High Level Comparison of Scripting vs. GUI
A High Level Comparison of Scripting vs. GUI
How to Build Out Your Scripts
A High Level Comparison of Scripting vs. GUI
How to Build Out Your Scripts
What Should you Script – Examples and Demos
Let’s Talk a Little Bit About PowerShell
A Verb-Noun
based scripting
language
Let’s Talk a Little Bit About PowerShell
A Verb-Noun
based scripting
language
Base system can
be extended with
modules to
enhance it.
Let’s Talk a Little Bit About PowerShell
A Verb-Noun
based scripting
language
Base system can
be extended
with modules to
enhance it.
Based on .NET
framework. Can
import assemblies
Let’s Talk a Little Bit About PowerShell
A Verb-Noun
based scripting
language
Base system can
be extended
with modules to
enhance it.
Based on .NET
framework. Can
import assemblies
Used for
manipulating
environments from
OS to applications
Let’s Talk a Little Bit About PowerShell
A Verb-Noun
based scripting
language
Base system can
be extended
with modules to
enhance it.
Based on .NET
framework. Can
import assemblies
Used for
manipulating
environments from
OS to applications
Let’s Talk a Little Bit About PowerShell
A Verb-Noun
based scripting
language
Base system can
be extended
with modules to
enhance it.
Based on .NET
framework. Can
import assemblies
Used for
manipulating
environments from
OS to applications
SharePoint On-Premises vs. SharePoint Online
On Premises vs. SharePoint Online
SPO PowerShell is
much more
limited compared
to On-Premises
0
200
400
600
800
1000
1200
SharePoint
2010
SharePoint
2013\2016
SharePoint
Online
PowerShell Command Comparison
On Premises vs. SharePoint Online
SPO PowerShell is
much more
limited compared
to On-Premises
0
5
10
15
20
25
30
35
SharePoint
Online
PowerShell Command Comparison
On Premises vs. SharePoint Online
SPO PowerShell is
much more
limited compared
to On-Premises
0
5
10
15
20
25
30
35
SharePoint
Online
PowerShell Command Comparison
33
On Premises vs. SharePoint Online
Require Global
Admin Rights to
Tenant
No
authentication
integration
Most commonly
used commands
in on-premises not
available
Commands
limited to few
areas of
SharePoint Admin
But Wait. There’s Hope!!
Patterns and
Practices
PowerShell
Commandlets
Open Source
project driven by
Microsoft
Updated Monthly
Added 426
commands for
SharePoint Online
by March 2017
Clicking Vs. Scripting
Let’s Compare
Create a single site column:
6-12 clicks depending on the options you select
A lot more if you are creating a look-up list for the column as well.
Create a single content type
About 6-8 to create
Lots more depending on number of columns to add and any other settings.
Creating a list
At least 6 clicks
So many more once you start configuring the list to meet your needs.
Number of Clicks with the GUI
Let’s Compare
Create a single site column:
Modify config file
Single line to execute created script
Create a single content type
Modify config file
Single line to execute created script
Creating a list
Modify config file
Single line to execute created script
Number of Clicks with PowerShell
Don’t worry!
Designing and Constructing Scripts
Helper Files
Don’t place
everything in
same script file
Break things off
into common
modules
Load what you
need, not
everything that is
there.
Overview of Helper\Common Modules
First thing to consider: a helper doesn’t have to be SharePoint related.
Overview of Helper\Common Modules
Separate common processes (list access, SPQuery Builders, Workflow)
The Config File
Allows for easy
modifications for
environment or
requirements
Allows for easy
reuse
Use to make
changes to script
without modifying
the script
Can use any file
type. XML
recommended
The Config File
Accessing
the Config
Building Your Script
Any significant
script you write
should have three
components
The main script The config The Helper Files
To Write or Not to Write. That is the Question
When must you use PowerShell Scripts?
When something
can’t be done
with the GUI
To Write or Not to Write. That is the Question
When should you use PowerShell Scripts?
Repeatable
Processes (creating
site columns, lists,
etc)
When you need
stronger control of
the outcome
(names, order, etc)
When it will take
more time to click
through all the
steps.
To Write or Not to Write. That is the Question
When should you NOT use PowerShell Scripts?
When it takes longer
to update the
config then to click
through the process
It’s really a
judgment call on
your part.
David Drever
Email : [email protected]
Twitter : @DavidMDrever
Blog: http://prairiedeveloper.com
Thank you for attending!
Any Questions?