Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited...

51
Stop Clicking Your Mouse Button! We Can Script That Making your day to day more efficient with PowerShell

Transcript of Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited...

Page 1: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

Stop Clicking Your Mouse Button! We Can Script ThatMaking your day to day more efficient with PowerShell

Page 2: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

SPSVancouver Sponsors

Page 3: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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

Page 4: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

Topics We are Covering Today

Page 5: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

A “30,000 Foot View” of PowerShell

Page 6: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

A “30,000 Foot View” of PowerShell

A High Level Comparison of Scripting vs. GUI

Page 7: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

A High Level Comparison of Scripting vs. GUI

How to Build Out Your Scripts

Page 8: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

A High Level Comparison of Scripting vs. GUI

How to Build Out Your Scripts

What Should you Script – Examples and Demos

Page 9: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

Let’s Talk a Little Bit About PowerShell

A Verb-Noun

based scripting

language

Page 10: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

Let’s Talk a Little Bit About PowerShell

A Verb-Noun

based scripting

language

Base system can

be extended with

modules to

enhance it.

Page 11: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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

Page 12: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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

Page 13: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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

Page 14: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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

Page 15: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

SharePoint On-Premises vs. SharePoint Online

Page 16: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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

Page 17: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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

Page 18: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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

Page 19: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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

Page 20: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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

Page 21: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

Clicking Vs. Scripting

Page 22: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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

Page 23: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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

Page 24: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

Don’t worry!

Page 25: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

Designing and Constructing Scripts

Page 26: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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.

Page 27: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

Overview of Helper\Common Modules

First thing to consider: a helper doesn’t have to be SharePoint related.

Page 28: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single
Page 29: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single
Page 30: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single
Page 31: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

Overview of Helper\Common Modules

Separate common processes (list access, SPQuery Builders, Workflow)

Page 32: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single
Page 33: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single
Page 34: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single
Page 35: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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

Page 36: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

The Config File

Page 37: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single
Page 38: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

Accessing

the Config

Page 39: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single
Page 40: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single
Page 41: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single
Page 42: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single
Page 43: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single
Page 44: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single
Page 45: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single
Page 46: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

Building Your Script

Any significant

script you write

should have three

components

The main script The config The Helper Files

Page 47: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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

Page 48: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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.

Page 49: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

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.

Page 50: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single
Page 51: Stop Clicking Your Mouse Button! We Can Script That€¦ · SPO PowerShell is much more limited compared to On-Premises 0 200 400 600 800 1000 1200 SharePoint 2010 ... Create a single

David Drever

Email : [email protected]

Twitter : @DavidMDrever

Blog: http://prairiedeveloper.com

Thank you for attending!

Any Questions?