SlideShare a Scribd company logo
1 of 24
PowerShell Basics for
Office Apps & Servers
Greg McMurray
SharePoint Saturday Utah
February 2019
Thank You SPSUtah 2019 Sponsors!
PLATINUM
• Lucidworks
• ZAACT
GOLD
• JourneyTEAM
• Sovereign SP
SILVER
• SkySync
ShareSki & SharePint
Intro – Greg
• Experience in Aerospace, Branding & Marketing,
Energy, Healthcare, Software
• Currently Senior Software Engineer at WECC
• Co-Founder of Aritus Computer Services, L.L.C.
• President of SharePoint / Office 365
and Dynamics 365 User Groups
• Find me online:
- @goyuix
- https://www.linkedin.com/in/goyuix
- https://stackoverflow.com/cv/goyuix
( top 2% of users )
Pluralsight IQ
https://www.pluralsight.com/product/skill-iq
Agenda
•PowerShell History & Basics
•SharePoint Online
•SharePoint PnP Library
•SharePoint On-Premises
•Office Apps Automation
This Photo by Unknown Author is licensed under CC BY-NC-ND
In the beginning
We needed a shell
Not that kind
of shell . . .
Our forebears: CSH
• Hey look! A C-Shell
• We are getting closer
• Created by Bill Joy as a graduate student
at UC Berkeley in the late 1970s
• “reads commands from a file … supports
filename wildcarding, piping, here
documents, command substitution,
variables and control structures for
condition-testing and iteration” – C-Shell,
Wikipedia
This Photo by Unknown Author is licensed under CC BY-SA
PowerShell Origin Story:
Monad & Manifesto
• Monad: Term coined by Leibniz to represent a fundamental
unit of existence, that are combined and composed into for
a purpose
• PowerShell paper in 2002 states: “provide a powerful,
consistent, intuitive, extensible and useful set of tools”
• Game changer: Piping objects instead of text
PowerShell Versions
• 1.0: for XP, Vista and Server 2003
• 2.0: included in Win 7 & Server 2008
• 3.0: included in Win 8 & Server 2012
• 4.0: included in Win 8.1 & Server 2012 R2
• 5.0/5.1: include in Win 10 & Server 2016
• 6.0: Becomes PowerShell Core
PowerShell Basics - cmdlets
•Verb-Noun Syntax
• Examples:
• Get-Help
• Get-Command
• Get-Member
• about* pages
PowerShell Basics - Variables
• Variables are labels that hold values
• Start with a dollar sign
• Values have types
• A bunch of special variables exist:
$ENV, $_, $error, etc.
PowerShell Basics - Piping
• The pipe character: |
•Quite literally “pipes” output from
the left side to the right as input
• Reminder: Everything is an object,
might be a string, or something else
PowerShell Basics - Control
•if () { } else {}
• do { } while ()
• foreach ($item in $stuff) {}
• $stuff | ForEach-Object { $_ }
SharePoint Online Management Shell
• https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-
online/connect-sharepoint-online?view=sharepoint-ps
• https://www.powershellgallery.com/packages/Microsoft.Online.Share
Point.PowerShell/
• Remember PowerShell needs elevated / admin permissions
• Install: Install-Module -Name Microsoft.Online.SharePoint.PowerShell
• Verify: Get-Module -Name Microsoft.Online.SharePoint.PowerShell
• Notes: You may need to update NuGet and trust the Gallery
PowerShell - SPO
$email = 'admin@tenant.com’
$url = 'https://tenant-admin.sharepoint.com'
$cred = Get-Credential $email
Connect-SPOService -Url $url -Credential $cred
• Note: If MFA is enabled, just omit the credential parameter and you
will be prompted through the authentication process
SharePoint Patterns and Practices (PnP)
• https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-
pnp/sharepoint-pnp-cmdlets?view=sharepoint-ps
• “Perform complex provisioning and artifact management”
• Uses Client Side Object Model (CSOM)
• Three different versions:
• Install-Module SharePointPnPPowerShellOnline
• Install-Module SharePointPnPPowerShell2016
• Install-Module SharePointPnPPowerShell2013
PowerShell - PnP
$url = 'https://your-tenant.sharepoint.com'
$cred = Get-Credential admin@tenant.com
Connect-PnPOnline –Url $url –Credentials $cred
$list = Get-PnPList /Lists/MyCustomList
Set-PnPList –Identity $list –Hidden $true
• Note: If MFA is enabled, change -Credential to -UseWebLogin
On-Premises SharePoint
• https://docs.microsoft.com/en-us/powershell/module/sharepoint-
server/?view=sharepoint-ps
• Uses the SharePoint .NET API
• Must be run on servers that are part of your on-premises farm
PowerShell – On-Premises
# $Host.Runspace.ThreadOptions = "ReuseThread"
# Add-PsSnapin Microsoft.SharePoint.PowerShell
$url = 'https://your-farm.domain.local’
$site = Get-SPSite $url
$site.AllWebs | Select-Object Title,Url
Note: You may need to uncomment the first two lines if you are running the
script outside of the SharePoint Management Shell (it auto-includes them)
Office Apps Automation
• Work with your data and surface it in applications
• A few different approaches are available
• COM / .NET API
• Office OpenXML
• How would you like to work with this data?
PowerShell – Word Automation
# Must have Office installed, bad for servers
$word = New-Object -ComObject word.application
$word.Visible = $true
$word.Documents.Add()
PowerShell – Excel Automation
# https://github.com/dfinke/ImportExcel
Install-Module -Name ImportExcel
Get-Process | Export-Excel
Learning More
• Microsoft and the community have TONS of resources
• Weekly YouTube calls for PnP work
• Channel 9, docs.microsoft.com
• Pluralsight, LinkedIn Learning / Lynda.com, Udemy, others
• Let’s chat: What do you want to build?
• Contact Me: @goyuix or linkedin.com/in/goyuix
• Github: https://github.com/goyuix/presentations/

More Related Content

What's hot

Wordpress beyond blogging
Wordpress beyond bloggingWordpress beyond blogging
Wordpress beyond bloggingJulien Minguely
 
AngularJS meets Rails
AngularJS meets RailsAngularJS meets Rails
AngularJS meets RailsElena Torró
 
How angularjs saves rails
How angularjs saves railsHow angularjs saves rails
How angularjs saves railsMichael He
 
Develop a vanilla.js spa you and your customers will love
Develop a vanilla.js spa you and your customers will loveDevelop a vanilla.js spa you and your customers will love
Develop a vanilla.js spa you and your customers will loveChris Love
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsTaylor Lovett
 
SharePoint Development 101
SharePoint Development 101SharePoint Development 101
SharePoint Development 101Greg Hurlman
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizationsChris Love
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfAlfresco Software
 
Best Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseTaylor Lovett
 
A 20 minute introduction to AngularJS for XPage developers
A 20 minute introduction to AngularJS for XPage developersA 20 minute introduction to AngularJS for XPage developers
A 20 minute introduction to AngularJS for XPage developersMark Leusink
 
Using RESTFUL APIs in ANGULARJS
Using RESTFUL APIs in ANGULARJSUsing RESTFUL APIs in ANGULARJS
Using RESTFUL APIs in ANGULARJSMindfire Solutions
 
Best Practices for WordPress
Best Practices for WordPressBest Practices for WordPress
Best Practices for WordPressTaylor Lovett
 
Episerver and search engines
Episerver and search enginesEpiserver and search engines
Episerver and search enginesMikko Huilaja
 
Elastic & Azure & Episever, Case Evira
Elastic & Azure & Episever, Case EviraElastic & Azure & Episever, Case Evira
Elastic & Azure & Episever, Case EviraMikko Huilaja
 
Externalizing Chatter Using Heroku, Angular.js, Node.js and Chatter REST APIs
Externalizing Chatter Using Heroku, Angular.js, Node.js and Chatter REST APIsExternalizing Chatter Using Heroku, Angular.js, Node.js and Chatter REST APIs
Externalizing Chatter Using Heroku, Angular.js, Node.js and Chatter REST APIsSalesforce Developers
 
You Got React.js in My PHP
You Got React.js in My PHPYou Got React.js in My PHP
You Got React.js in My PHPTaylor Lovett
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsChris Love
 
PHP, OAuth, Web Services and YQL
PHP, OAuth, Web Services and YQLPHP, OAuth, Web Services and YQL
PHP, OAuth, Web Services and YQLkulor
 

What's hot (20)

Apex & jQuery Mobile
Apex & jQuery MobileApex & jQuery Mobile
Apex & jQuery Mobile
 
Wordpress beyond blogging
Wordpress beyond bloggingWordpress beyond blogging
Wordpress beyond blogging
 
AngularJS meets Rails
AngularJS meets RailsAngularJS meets Rails
AngularJS meets Rails
 
How angularjs saves rails
How angularjs saves railsHow angularjs saves rails
How angularjs saves rails
 
Develop a vanilla.js spa you and your customers will love
Develop a vanilla.js spa you and your customers will loveDevelop a vanilla.js spa you and your customers will love
Develop a vanilla.js spa you and your customers will love
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
 
SharePoint Development 101
SharePoint Development 101SharePoint Development 101
SharePoint Development 101
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring Surf
 
Best Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in Enterprise
 
A 20 minute introduction to AngularJS for XPage developers
A 20 minute introduction to AngularJS for XPage developersA 20 minute introduction to AngularJS for XPage developers
A 20 minute introduction to AngularJS for XPage developers
 
Using RESTFUL APIs in ANGULARJS
Using RESTFUL APIs in ANGULARJSUsing RESTFUL APIs in ANGULARJS
Using RESTFUL APIs in ANGULARJS
 
Best Practices for WordPress
Best Practices for WordPressBest Practices for WordPress
Best Practices for WordPress
 
Episerver and search engines
Episerver and search enginesEpiserver and search engines
Episerver and search engines
 
Elastic & Azure & Episever, Case Evira
Elastic & Azure & Episever, Case EviraElastic & Azure & Episever, Case Evira
Elastic & Azure & Episever, Case Evira
 
Externalizing Chatter Using Heroku, Angular.js, Node.js and Chatter REST APIs
Externalizing Chatter Using Heroku, Angular.js, Node.js and Chatter REST APIsExternalizing Chatter Using Heroku, Angular.js, Node.js and Chatter REST APIs
Externalizing Chatter Using Heroku, Angular.js, Node.js and Chatter REST APIs
 
Dfc 2018 NativeScript
Dfc 2018 NativeScriptDfc 2018 NativeScript
Dfc 2018 NativeScript
 
You Got React.js in My PHP
You Got React.js in My PHPYou Got React.js in My PHP
You Got React.js in My PHP
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applications
 
PHP, OAuth, Web Services and YQL
PHP, OAuth, Web Services and YQLPHP, OAuth, Web Services and YQL
PHP, OAuth, Web Services and YQL
 

Similar to PowerShell Basics for Office Apps and Servers

Mastering Office 365 with PowerShell - TechDays Finland 2020
Mastering Office 365 with PowerShell -  TechDays Finland 2020Mastering Office 365 with PowerShell -  TechDays Finland 2020
Mastering Office 365 with PowerShell - TechDays Finland 2020Matti Paukkonen [MVP]
 
D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...
D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...
D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...SPS Paris
 
SPSTC - PowerShell - Through the SharePoint Looking Glass
SPSTC - PowerShell - Through the SharePoint Looking GlassSPSTC - PowerShell - Through the SharePoint Looking Glass
SPSTC - PowerShell - Through the SharePoint Looking GlassBrian Caauwe
 
Introduction to PowerShell for SharePoint Admins and Developers
Introduction to PowerShell for SharePoint Admins and DevelopersIntroduction to PowerShell for SharePoint Admins and Developers
Introduction to PowerShell for SharePoint Admins and DevelopersMichael Blumenthal (Microsoft MVP)
 
PowerShell Introduction to Administering SharePoint On-Premises & O365
PowerShell Introduction to Administering SharePoint On-Premises & O365PowerShell Introduction to Administering SharePoint On-Premises & O365
PowerShell Introduction to Administering SharePoint On-Premises & O365Michael Greene
 
SPSSTL - PowerShell - Through the SharePoint Looking Glass
SPSSTL - PowerShell - Through the SharePoint Looking GlassSPSSTL - PowerShell - Through the SharePoint Looking Glass
SPSSTL - PowerShell - Through the SharePoint Looking GlassBrian Caauwe
 
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshop
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshopIntroduction to PowerShell - Be a PowerShell Hero - SPFest workshop
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshopMichael Blumenthal (Microsoft MVP)
 
O365Con18 - Hybrid SharePoint Deep Dive - Thomas Vochten
O365Con18 - Hybrid SharePoint Deep Dive - Thomas VochtenO365Con18 - Hybrid SharePoint Deep Dive - Thomas Vochten
O365Con18 - Hybrid SharePoint Deep Dive - Thomas VochtenNCCOMMS
 
SPSNL17 - Implementing SharePoint hybrid search, start to finish - Thomas Voc...
SPSNL17 - Implementing SharePoint hybrid search, start to finish - Thomas Voc...SPSNL17 - Implementing SharePoint hybrid search, start to finish - Thomas Voc...
SPSNL17 - Implementing SharePoint hybrid search, start to finish - Thomas Voc...DIWUG
 
I6 - State of the art SharePoint PowerShell Nation 2017 - Spencer Harbar
I6 - State of the art SharePoint PowerShell Nation 2017 - Spencer HarbarI6 - State of the art SharePoint PowerShell Nation 2017 - Spencer Harbar
I6 - State of the art SharePoint PowerShell Nation 2017 - Spencer HarbarSPS Paris
 
Utilizing jQuery in SharePoint: Get More Done Faster
Utilizing jQuery in SharePoint: Get More Done FasterUtilizing jQuery in SharePoint: Get More Done Faster
Utilizing jQuery in SharePoint: Get More Done FasterMark Rackley
 
SharePoint Saturday New York: PowerShell for Office 365
SharePoint Saturday New York: PowerShell for Office 365SharePoint Saturday New York: PowerShell for Office 365
SharePoint Saturday New York: PowerShell for Office 365Vlad Catrinescu
 
Managing SharePoint Anywhere with Windows PowerShell
Managing SharePoint Anywhere with Windows PowerShellManaging SharePoint Anywhere with Windows PowerShell
Managing SharePoint Anywhere with Windows PowerShellRyan Dennis
 
Spsatx slides (widescreen)
Spsatx slides (widescreen)Spsatx slides (widescreen)
Spsatx slides (widescreen)Ryan Dennis
 
SPO Migration - New API
SPO Migration - New APISPO Migration - New API
SPO Migration - New APIAshish Trivedi
 
Office 365 & PowerShell - A match made in heaven
Office 365 & PowerShell - A match made in heavenOffice 365 & PowerShell - A match made in heaven
Office 365 & PowerShell - A match made in heavenSébastien Levert
 
SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...
SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...
SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...Comunidade Portuguesa de SharePoiint
 
SharePoint 2013 App or Not to App
SharePoint 2013 App or Not to AppSharePoint 2013 App or Not to App
SharePoint 2013 App or Not to AppKenneth Maglio
 
The Path through SharePoint Migrations
The Path through SharePoint MigrationsThe Path through SharePoint Migrations
The Path through SharePoint MigrationsBrian Caauwe
 

Similar to PowerShell Basics for Office Apps and Servers (20)

Mastering Office 365 with PowerShell - TechDays Finland 2020
Mastering Office 365 with PowerShell -  TechDays Finland 2020Mastering Office 365 with PowerShell -  TechDays Finland 2020
Mastering Office 365 with PowerShell - TechDays Finland 2020
 
D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...
D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...
D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...
 
SPSTC - PowerShell - Through the SharePoint Looking Glass
SPSTC - PowerShell - Through the SharePoint Looking GlassSPSTC - PowerShell - Through the SharePoint Looking Glass
SPSTC - PowerShell - Through the SharePoint Looking Glass
 
Introduction to PowerShell for SharePoint Admins and Developers
Introduction to PowerShell for SharePoint Admins and DevelopersIntroduction to PowerShell for SharePoint Admins and Developers
Introduction to PowerShell for SharePoint Admins and Developers
 
PowerShell Introduction to Administering SharePoint On-Premises & O365
PowerShell Introduction to Administering SharePoint On-Premises & O365PowerShell Introduction to Administering SharePoint On-Premises & O365
PowerShell Introduction to Administering SharePoint On-Premises & O365
 
SPSSTL - PowerShell - Through the SharePoint Looking Glass
SPSSTL - PowerShell - Through the SharePoint Looking GlassSPSSTL - PowerShell - Through the SharePoint Looking Glass
SPSSTL - PowerShell - Through the SharePoint Looking Glass
 
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshop
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshopIntroduction to PowerShell - Be a PowerShell Hero - SPFest workshop
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshop
 
O365Con18 - Hybrid SharePoint Deep Dive - Thomas Vochten
O365Con18 - Hybrid SharePoint Deep Dive - Thomas VochtenO365Con18 - Hybrid SharePoint Deep Dive - Thomas Vochten
O365Con18 - Hybrid SharePoint Deep Dive - Thomas Vochten
 
SPSNL17 - Implementing SharePoint hybrid search, start to finish - Thomas Voc...
SPSNL17 - Implementing SharePoint hybrid search, start to finish - Thomas Voc...SPSNL17 - Implementing SharePoint hybrid search, start to finish - Thomas Voc...
SPSNL17 - Implementing SharePoint hybrid search, start to finish - Thomas Voc...
 
I6 - State of the art SharePoint PowerShell Nation 2017 - Spencer Harbar
I6 - State of the art SharePoint PowerShell Nation 2017 - Spencer HarbarI6 - State of the art SharePoint PowerShell Nation 2017 - Spencer Harbar
I6 - State of the art SharePoint PowerShell Nation 2017 - Spencer Harbar
 
Utilizing jQuery in SharePoint: Get More Done Faster
Utilizing jQuery in SharePoint: Get More Done FasterUtilizing jQuery in SharePoint: Get More Done Faster
Utilizing jQuery in SharePoint: Get More Done Faster
 
SharePoint Saturday New York: PowerShell for Office 365
SharePoint Saturday New York: PowerShell for Office 365SharePoint Saturday New York: PowerShell for Office 365
SharePoint Saturday New York: PowerShell for Office 365
 
Managing SharePoint Anywhere with Windows PowerShell
Managing SharePoint Anywhere with Windows PowerShellManaging SharePoint Anywhere with Windows PowerShell
Managing SharePoint Anywhere with Windows PowerShell
 
Spsatx slides (widescreen)
Spsatx slides (widescreen)Spsatx slides (widescreen)
Spsatx slides (widescreen)
 
SPO Migration - New API
SPO Migration - New APISPO Migration - New API
SPO Migration - New API
 
Office 365 & PowerShell - A match made in heaven
Office 365 & PowerShell - A match made in heavenOffice 365 & PowerShell - A match made in heaven
Office 365 & PowerShell - A match made in heaven
 
SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...
SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...
SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...
 
SharePoint 2013 App or Not to App
SharePoint 2013 App or Not to AppSharePoint 2013 App or Not to App
SharePoint 2013 App or Not to App
 
Introduction to PowerShell at Chicago Code Camp 2014
Introduction to PowerShell at Chicago Code Camp 2014Introduction to PowerShell at Chicago Code Camp 2014
Introduction to PowerShell at Chicago Code Camp 2014
 
The Path through SharePoint Migrations
The Path through SharePoint MigrationsThe Path through SharePoint Migrations
The Path through SharePoint Migrations
 

More from Greg McMurray

Power Platform Introduction - Utah PowerApps and Flow User Group
Power Platform Introduction - Utah PowerApps and Flow User GroupPower Platform Introduction - Utah PowerApps and Flow User Group
Power Platform Introduction - Utah PowerApps and Flow User GroupGreg McMurray
 
SharePoint Search - August 2019 at Utah SharePoint User Group
SharePoint Search - August 2019 at Utah SharePoint User GroupSharePoint Search - August 2019 at Utah SharePoint User Group
SharePoint Search - August 2019 at Utah SharePoint User GroupGreg McMurray
 
Introduction to SQL Server Graph DB
Introduction to SQL Server Graph DBIntroduction to SQL Server Graph DB
Introduction to SQL Server Graph DBGreg McMurray
 
Power BI Streaming Datasets - San Diego BI Users Group
Power BI Streaming Datasets - San Diego BI Users GroupPower BI Streaming Datasets - San Diego BI Users Group
Power BI Streaming Datasets - San Diego BI Users GroupGreg McMurray
 
Dynamics 365 Web API - CRMUG April 2018
Dynamics 365 Web API - CRMUG April 2018Dynamics 365 Web API - CRMUG April 2018
Dynamics 365 Web API - CRMUG April 2018Greg McMurray
 
SQL Server Temporal Tables
SQL Server Temporal TablesSQL Server Temporal Tables
SQL Server Temporal TablesGreg McMurray
 
Sql Server 2016 and JSON
Sql Server 2016 and JSONSql Server 2016 and JSON
Sql Server 2016 and JSONGreg McMurray
 
Power BI Streaming Datasets
Power BI Streaming DatasetsPower BI Streaming Datasets
Power BI Streaming DatasetsGreg McMurray
 
Introduction to Microsoft Teams
Introduction to Microsoft TeamsIntroduction to Microsoft Teams
Introduction to Microsoft TeamsGreg McMurray
 
CRMUG Presentation on Dynamics CRM integration with SharePoint
CRMUG Presentation on Dynamics CRM integration with SharePointCRMUG Presentation on Dynamics CRM integration with SharePoint
CRMUG Presentation on Dynamics CRM integration with SharePointGreg McMurray
 
Real World Power Query for Excel and Power BI - SQL Saturday #576
Real World Power Query for Excel and Power BI - SQL Saturday #576Real World Power Query for Excel and Power BI - SQL Saturday #576
Real World Power Query for Excel and Power BI - SQL Saturday #576Greg McMurray
 

More from Greg McMurray (11)

Power Platform Introduction - Utah PowerApps and Flow User Group
Power Platform Introduction - Utah PowerApps and Flow User GroupPower Platform Introduction - Utah PowerApps and Flow User Group
Power Platform Introduction - Utah PowerApps and Flow User Group
 
SharePoint Search - August 2019 at Utah SharePoint User Group
SharePoint Search - August 2019 at Utah SharePoint User GroupSharePoint Search - August 2019 at Utah SharePoint User Group
SharePoint Search - August 2019 at Utah SharePoint User Group
 
Introduction to SQL Server Graph DB
Introduction to SQL Server Graph DBIntroduction to SQL Server Graph DB
Introduction to SQL Server Graph DB
 
Power BI Streaming Datasets - San Diego BI Users Group
Power BI Streaming Datasets - San Diego BI Users GroupPower BI Streaming Datasets - San Diego BI Users Group
Power BI Streaming Datasets - San Diego BI Users Group
 
Dynamics 365 Web API - CRMUG April 2018
Dynamics 365 Web API - CRMUG April 2018Dynamics 365 Web API - CRMUG April 2018
Dynamics 365 Web API - CRMUG April 2018
 
SQL Server Temporal Tables
SQL Server Temporal TablesSQL Server Temporal Tables
SQL Server Temporal Tables
 
Sql Server 2016 and JSON
Sql Server 2016 and JSONSql Server 2016 and JSON
Sql Server 2016 and JSON
 
Power BI Streaming Datasets
Power BI Streaming DatasetsPower BI Streaming Datasets
Power BI Streaming Datasets
 
Introduction to Microsoft Teams
Introduction to Microsoft TeamsIntroduction to Microsoft Teams
Introduction to Microsoft Teams
 
CRMUG Presentation on Dynamics CRM integration with SharePoint
CRMUG Presentation on Dynamics CRM integration with SharePointCRMUG Presentation on Dynamics CRM integration with SharePoint
CRMUG Presentation on Dynamics CRM integration with SharePoint
 
Real World Power Query for Excel and Power BI - SQL Saturday #576
Real World Power Query for Excel and Power BI - SQL Saturday #576Real World Power Query for Excel and Power BI - SQL Saturday #576
Real World Power Query for Excel and Power BI - SQL Saturday #576
 

Recently uploaded

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

PowerShell Basics for Office Apps and Servers

  • 1. PowerShell Basics for Office Apps & Servers Greg McMurray SharePoint Saturday Utah February 2019
  • 2. Thank You SPSUtah 2019 Sponsors! PLATINUM • Lucidworks • ZAACT GOLD • JourneyTEAM • Sovereign SP SILVER • SkySync ShareSki & SharePint
  • 3. Intro – Greg • Experience in Aerospace, Branding & Marketing, Energy, Healthcare, Software • Currently Senior Software Engineer at WECC • Co-Founder of Aritus Computer Services, L.L.C. • President of SharePoint / Office 365 and Dynamics 365 User Groups • Find me online: - @goyuix - https://www.linkedin.com/in/goyuix - https://stackoverflow.com/cv/goyuix ( top 2% of users )
  • 5. Agenda •PowerShell History & Basics •SharePoint Online •SharePoint PnP Library •SharePoint On-Premises •Office Apps Automation This Photo by Unknown Author is licensed under CC BY-NC-ND
  • 6. In the beginning We needed a shell
  • 7. Not that kind of shell . . .
  • 8. Our forebears: CSH • Hey look! A C-Shell • We are getting closer • Created by Bill Joy as a graduate student at UC Berkeley in the late 1970s • “reads commands from a file … supports filename wildcarding, piping, here documents, command substitution, variables and control structures for condition-testing and iteration” – C-Shell, Wikipedia This Photo by Unknown Author is licensed under CC BY-SA
  • 9. PowerShell Origin Story: Monad & Manifesto • Monad: Term coined by Leibniz to represent a fundamental unit of existence, that are combined and composed into for a purpose • PowerShell paper in 2002 states: “provide a powerful, consistent, intuitive, extensible and useful set of tools” • Game changer: Piping objects instead of text
  • 10. PowerShell Versions • 1.0: for XP, Vista and Server 2003 • 2.0: included in Win 7 & Server 2008 • 3.0: included in Win 8 & Server 2012 • 4.0: included in Win 8.1 & Server 2012 R2 • 5.0/5.1: include in Win 10 & Server 2016 • 6.0: Becomes PowerShell Core
  • 11. PowerShell Basics - cmdlets •Verb-Noun Syntax • Examples: • Get-Help • Get-Command • Get-Member • about* pages
  • 12. PowerShell Basics - Variables • Variables are labels that hold values • Start with a dollar sign • Values have types • A bunch of special variables exist: $ENV, $_, $error, etc.
  • 13. PowerShell Basics - Piping • The pipe character: | •Quite literally “pipes” output from the left side to the right as input • Reminder: Everything is an object, might be a string, or something else
  • 14. PowerShell Basics - Control •if () { } else {} • do { } while () • foreach ($item in $stuff) {} • $stuff | ForEach-Object { $_ }
  • 15. SharePoint Online Management Shell • https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint- online/connect-sharepoint-online?view=sharepoint-ps • https://www.powershellgallery.com/packages/Microsoft.Online.Share Point.PowerShell/ • Remember PowerShell needs elevated / admin permissions • Install: Install-Module -Name Microsoft.Online.SharePoint.PowerShell • Verify: Get-Module -Name Microsoft.Online.SharePoint.PowerShell • Notes: You may need to update NuGet and trust the Gallery
  • 16. PowerShell - SPO $email = 'admin@tenant.com’ $url = 'https://tenant-admin.sharepoint.com' $cred = Get-Credential $email Connect-SPOService -Url $url -Credential $cred • Note: If MFA is enabled, just omit the credential parameter and you will be prompted through the authentication process
  • 17. SharePoint Patterns and Practices (PnP) • https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint- pnp/sharepoint-pnp-cmdlets?view=sharepoint-ps • “Perform complex provisioning and artifact management” • Uses Client Side Object Model (CSOM) • Three different versions: • Install-Module SharePointPnPPowerShellOnline • Install-Module SharePointPnPPowerShell2016 • Install-Module SharePointPnPPowerShell2013
  • 18. PowerShell - PnP $url = 'https://your-tenant.sharepoint.com' $cred = Get-Credential admin@tenant.com Connect-PnPOnline –Url $url –Credentials $cred $list = Get-PnPList /Lists/MyCustomList Set-PnPList –Identity $list –Hidden $true • Note: If MFA is enabled, change -Credential to -UseWebLogin
  • 19. On-Premises SharePoint • https://docs.microsoft.com/en-us/powershell/module/sharepoint- server/?view=sharepoint-ps • Uses the SharePoint .NET API • Must be run on servers that are part of your on-premises farm
  • 20. PowerShell – On-Premises # $Host.Runspace.ThreadOptions = "ReuseThread" # Add-PsSnapin Microsoft.SharePoint.PowerShell $url = 'https://your-farm.domain.local’ $site = Get-SPSite $url $site.AllWebs | Select-Object Title,Url Note: You may need to uncomment the first two lines if you are running the script outside of the SharePoint Management Shell (it auto-includes them)
  • 21. Office Apps Automation • Work with your data and surface it in applications • A few different approaches are available • COM / .NET API • Office OpenXML • How would you like to work with this data?
  • 22. PowerShell – Word Automation # Must have Office installed, bad for servers $word = New-Object -ComObject word.application $word.Visible = $true $word.Documents.Add()
  • 23. PowerShell – Excel Automation # https://github.com/dfinke/ImportExcel Install-Module -Name ImportExcel Get-Process | Export-Excel
  • 24. Learning More • Microsoft and the community have TONS of resources • Weekly YouTube calls for PnP work • Channel 9, docs.microsoft.com • Pluralsight, LinkedIn Learning / Lynda.com, Udemy, others • Let’s chat: What do you want to build? • Contact Me: @goyuix or linkedin.com/in/goyuix • Github: https://github.com/goyuix/presentations/