Online Conference
June 17th and 18th 2015
EVENTS.COLLAB365.COMMUNITY
Introduction to PowerShell
EVENTS.COLLAB365.COMMUNITY
Who is Michael
Blumenthal?
Michael@Blumenthalit.com
Twitter: @MichaelBL
LinkedIn: http://bit.ly/MBB-LI
https://michaelblumenthal.me
TechCommunity.Microsoft.com
Tenant Admin at a leading broadcast media
company
Office 365 MVP
Dev/ITPro Mix
In IT Consulting since 1995
PowerShelling since 2007
Contact
EVENTS.COLLAB365.COMMUNITY
What is PowerShell?
EVENTS.COLLAB365.COMMUNITY
Why is PowerShell AWESOME?
Write-Host “SO easy to use!”
No Compiling!
EVENTS.COLLAB365.COMMUNITY
• It’s Easy to Get Started!1
• Learn the PowerShell Syntax2
• Working with O3653
• Best Practices4
PowerShell puts .NET at your fingertips!
EVENTS.COLLAB365.COMMUNITY
Chapter 1
It’s Easy to get Started!
EVENTS.COLLAB365.COMMUNITY
Getting Started with PowerShell
2003
2008,R2
2012, R2
2016
7, 8, 8.1, 10
EVENTS.COLLAB365.COMMUNITY
The Command Line Window
EVENTS.COLLAB365.COMMUNITY
Windows Feature
Win
8.x
Win
8-10
EVENTS.COLLAB365.COMMUNITY
The Integrated Script Editor
EVENTS.COLLAB365.COMMUNITY
PowerShell V3-5 ISE
EVENTS.COLLAB365.COMMUNITY
Intellisense!
EVENTS.COLLAB365.COMMUNITY
Chapter 2
Learn the PowerShell Syntax!
EVENTS.COLLAB365.COMMUNITY
Symbols, Keywords, and Syntax! Oh My!
• Variables1
• Commands2
• Piping3
• Comparisons4
• Flow Control5
• Filtering6
EVENTS.COLLAB365.COMMUNITY
Reading Symbols in Code
• (tal Guidance
• Moe, Larry, and }
• The universe started with the
Big !
• !Important
• A # of Bacon and # Browns
EVENTS.COLLAB365.COMMUNITY
Variables
• Case Insensitive, Dynamic typing
$something
$true, $false, $null, $profile
$myMessage= “Hello, World”
1
Introduction to PowerShell for Office 365 Global Tenant Admins
EVENTS.COLLAB365.COMMUNITY
Commands are called cmdlets.
Verb-Noun
Built-in, Extensible
Get-Help
Get-Member
Get-Command
2
EVENTS.COLLAB365.COMMUNITY
Help!
Discoverability
EVENTS.COLLAB365.COMMUNITY
Get-Command
• Find Cmdlets
• Get details of cmdlets and applications
EVENTS.COLLAB365.COMMUNITY
Aliases
• Dir
• Sort
• Select
• Foreach, also %
Alias cmdlet
• Get-ChildItem
• Sort-object
• Select-object
• Foreach-object
EVENTS.COLLAB365.COMMUNITY
The Power of Piping!
Output Of
Command 1
Input of
Command 2
3
EVENTS.COLLAB365.COMMUNITY
Example
EVENTS.COLLAB365.COMMUNITY
EVENTS.COLLAB365.COMMUNITY
Dial zero for an…
4
Operator
-eq -le
-ne -like
-gt -notlike
-ge -match
-lt -notmatch
Example
EVENTS.COLLAB365.COMMUNITY
Taking Control of the Flow
• If (Test) {Commands} else {Commands}
• if ($web.Title –ne “”) {Write-Host $web.Title}If
• For (Init;Test;Repeat) {Commands}
• for($i=1; $i -le 10; $i++) {Write-Host $i}For
• Foreach (Item in Collection) {Commands}
• Foreach ($gumball in $CandyBag) {$gumball.color}
• Collection | Foreach {Commands}
ForEach
• While (Condition){Commands}
• while($val -ne 3){$val++; Write-Host $val}While
5
EVENTS.COLLAB365.COMMUNITY
Example
EVENTS.COLLAB365.COMMUNITY
Where-Object
•Where {<Test>}Syntax
• V1&2:
Dir | Where {$_.Name –like “B*”}
• V3+:
Dir | where Name –like B*
Example
6
EVENTS.COLLAB365.COMMUNITY
Executing Scripts
.filename.ps1
Set-ExecutionPolicy
Unrestricted
EVENTS.COLLAB365.COMMUNITY
Chapter 3
Connecting To O365
EVENTS.COLLAB365.COMMUNITY
Get the Cmdlets!
Verb-MSOL*AAD
Remote SessionEXO
Verb-PNP*PNP
new-CSOnlineSession; RemoteSK4B
Verb-SPO*SPO
EVENTS.COLLAB365.COMMUNITY
EVENTS.COLLAB365.COMMUNITY
Chapter 4
Best Practices
EVENTS.COLLAB365.COMMUNITY
Use Functions
• Function global:Do-Something(){
• }
• Function global:Do-Something($someParameter){
• }
• Function global:Do-Something{
• param ([type]$someParameter=$(“Default Expression”))
• }
EVENTS.COLLAB365.COMMUNITY
Follow the Naming
Convention!
•Verb-Noun
• 98 Verbs
EVENTS.COLLAB365.COMMUNITY
Comment your functions
• <#
• .SYNOPSIS –a brief explanation of what the script or function does.
• .DESCRIPTION – a more detailed explanation of what the script or function does.
• .PARAMETER name – an explanation of a specific parameter. Replace name with the parameter
name. You can have one of these sections for each parameter the script or function uses.
• .EXAMPLE – an example of how to use the script or function. You can have multiple .EXAMPLE
sections if you want to provide more than one example.
• .NOTES – any miscellaneous notes on using the script or function.
• .LINK – a cross-reference to another help topic; you can have more than one of these. If you
include a URL beginning with http:// or https://, the shell will open that URL when the Help
command’s –online parameter is used.
• #>
EVENTS.COLLAB365.COMMUNITY
Search for Commands
Refresh the command list
Actions you can take
EVENTS.COLLAB365.COMMUNITY
Self Announcing Functions
…
EVENTS.COLLAB365.COMMUNITY
Source Code Control
EVENTS.COLLAB365.COMMUNITY
More Good Ideas
• Always read scripts before
running them
EVENTS.COLLAB365.COMMUNITY
More Good Ideas
• Always read scripts before running
them.
• Make yours safe when others
don’t
EVENTS.COLLAB365.COMMUNITY
More Good Ideas
• Always read scripts before running
them
• Make yours safe when others don’t
• Check for valid parameter values
• get-help
about_Functions_Advanced_Parameters
EVENTS.COLLAB365.COMMUNITY
More Good Ideas
• Always read scripts before running them
• Make yours safe when others don’t
• Check for valid parameter values
• get-help about_Functions_Advanced_Parameters
• Do error handling
• get-help about_Try_Catch_Finally
• get-help about_CommonParameters
– -ErrorAction and -ErrorVariable
EVENTS.COLLAB365.COMMUNITY
http://bit.ly/poshres
Resources
EVENTS.COLLAB365.COMMUNITY
Script something today!
It’s Easy to Get
Started!
PowerShell
Syntax
Office 365

More Related Content

PPTX
How to create your own WordPress plugin
PDF
[GeekTalk#2] Takaaki Mizuno - Api Url Design
PPTX
The Open-source Eclipse Plugin for Force.com Development, Summer ‘14
PDF
State of the Word 2015, WordCamp US
PPTX
SharePoint PowerShell for the Admin and Developer - A Venn Diagram Experience
ODP
The Future Of WordPress Presentation
PPTX
Cloud hub with mule
PDF
An Exploration of Cross-product App Experiences
How to create your own WordPress plugin
[GeekTalk#2] Takaaki Mizuno - Api Url Design
The Open-source Eclipse Plugin for Force.com Development, Summer ‘14
State of the Word 2015, WordCamp US
SharePoint PowerShell for the Admin and Developer - A Venn Diagram Experience
The Future Of WordPress Presentation
Cloud hub with mule
An Exploration of Cross-product App Experiences

What's hot (20)

PDF
Deploying and Scaling Your First Cloud Application with Amazon Lightsail
PDF
So, you want to be a plugin developer?
PDF
The Works 2018 - Software Track - Development 101: Build Using API and Overvi...
PDF
Wordcamp Toronto Presentation
PDF
A Simple Plugin Architecture for Wicket
PDF
10 Must-Use Components for Your Mobile Apps, James Clancey
PPTX
Xamarin.Forms or Write Once, Run Anywhere
PDF
An easy guide to Plugin Development
PPTX
Inside Wordnik's Architecture
PDF
Get Started in Professional WordPress Design & Development
PDF
WordPress REST API
PDF
Unlocking the Magical Powers of WP_Query
PPTX
Familiarity Breeds Contempt (Or why all APIs suck, even yours.)
PPTX
Configuration as Code: The Job DSL Plugin
PDF
Instagram filters
PDF
Automate Amazon S3 Storage with Alexandria
PDF
Jumping Into WordPress Plugin Programming
PDF
4 Changes We're Making to Help you be Successful in the Cloud
PDF
WordPress and Client Side Web Applications WCTO
PDF
Symfony Live San Francisco 2017 - Symfony @ OpenSky
Deploying and Scaling Your First Cloud Application with Amazon Lightsail
So, you want to be a plugin developer?
The Works 2018 - Software Track - Development 101: Build Using API and Overvi...
Wordcamp Toronto Presentation
A Simple Plugin Architecture for Wicket
10 Must-Use Components for Your Mobile Apps, James Clancey
Xamarin.Forms or Write Once, Run Anywhere
An easy guide to Plugin Development
Inside Wordnik's Architecture
Get Started in Professional WordPress Design & Development
WordPress REST API
Unlocking the Magical Powers of WP_Query
Familiarity Breeds Contempt (Or why all APIs suck, even yours.)
Configuration as Code: The Job DSL Plugin
Instagram filters
Automate Amazon S3 Storage with Alexandria
Jumping Into WordPress Plugin Programming
4 Changes We're Making to Help you be Successful in the Cloud
WordPress and Client Side Web Applications WCTO
Symfony Live San Francisco 2017 - Symfony @ OpenSky
Ad

Similar to Introduction to PowerShell for Office 365 Global Tenant Admins (20)

PPTX
Introduction to PowerShell - Presented to the SDC Nov 3, 2014
PPTX
Best practices and tools for PowerShell and SharePoint Scripting SharePointFe...
PPTX
Introduction to PowerShell
PPTX
Introduction to PowerShell for SharePoint Admins and Developers
PPTX
Enterprise Node - Code Discoverability
PPTX
Introduction to PowerShell at Chicago Code Camp 2015
PPTX
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshop
PPTX
Salesforce Development Best Practices
PDF
Webinar: Deploy Microsoft Teams and stay in control
PPTX
PowerShell Zero To Hero Workshop!
PPTX
PowerShell for the Anxious ITPro
PDF
Add-On Development: EE Expects that Every Developer will do his Duty
PDF
presentation
PDF
Add-On Development: EE Expects that Every Developer will do his Duty
PDF
presentation
PPTX
Office add ins community call-January 2019
PPTX
Testing for Logic App Solutions | Integration Monday
PPTX
Automating Enterprise Application Deployments with PowerShell
PDF
Get things done with Yii - quickly build webapplications
PDF
Let's Write Better Node Modules
Introduction to PowerShell - Presented to the SDC Nov 3, 2014
Best practices and tools for PowerShell and SharePoint Scripting SharePointFe...
Introduction to PowerShell
Introduction to PowerShell for SharePoint Admins and Developers
Enterprise Node - Code Discoverability
Introduction to PowerShell at Chicago Code Camp 2015
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshop
Salesforce Development Best Practices
Webinar: Deploy Microsoft Teams and stay in control
PowerShell Zero To Hero Workshop!
PowerShell for the Anxious ITPro
Add-On Development: EE Expects that Every Developer will do his Duty
presentation
Add-On Development: EE Expects that Every Developer will do his Duty
presentation
Office add ins community call-January 2019
Testing for Logic App Solutions | Integration Monday
Automating Enterprise Application Deployments with PowerShell
Get things done with Yii - quickly build webapplications
Let's Write Better Node Modules
Ad

More from Michael Blumenthal (Microsoft MVP) (20)

PPTX
Teaching Prompting and Prompt Sharing to End Users.pptx
PPTX
What's New in Copilot in YOUR Tenant - Ignite 2024 - THR586.pptx
PPTX
How and Why You Should Manage M365 Message Center in Planner
PPTX
Tracking what's new and next for Teams in Your tenant.pptx
PPTX
Collaboration Fundamentals - ALI Modern Intranets May 2023
PPTX
Hidden Gems of Office - Teams Day Online Sept 2022
PPTX
So You Think You Have OneDrive Deployed.pptx
PPTX
Toastmasters Word of the Day - Feghoot.pptx
PPTX
10 Tips to Make You A Better Speaker.pptx
PPTX
Hidden Gems of Microsoft Office
PPTX
October 2020 Office 365 Adoption Users Group meeting agenda
PPTX
August 2020 Office 365 Adoption Users Group meeting agenda
PPTX
Lessons Learned while Deploying OneDrive Sync
PPTX
2020 July Office 365 AI news for the Midwest AI Group (MAIG)
PPTX
June 2020 Office 365 Adoption User Group meeting agenda
PPTX
May 2020 Office 365 Adoption User Group Meeting Agenda
PPTX
M365 The Tour Israel: Deploying OneDrive Sync
PPTX
April 2020 Office 365 Adoption Users Group meeting agenda
PPTX
Overview of Office 365: The Elephant in the Room
PPTX
Deploying OneDrive Sync
Teaching Prompting and Prompt Sharing to End Users.pptx
What's New in Copilot in YOUR Tenant - Ignite 2024 - THR586.pptx
How and Why You Should Manage M365 Message Center in Planner
Tracking what's new and next for Teams in Your tenant.pptx
Collaboration Fundamentals - ALI Modern Intranets May 2023
Hidden Gems of Office - Teams Day Online Sept 2022
So You Think You Have OneDrive Deployed.pptx
Toastmasters Word of the Day - Feghoot.pptx
10 Tips to Make You A Better Speaker.pptx
Hidden Gems of Microsoft Office
October 2020 Office 365 Adoption Users Group meeting agenda
August 2020 Office 365 Adoption Users Group meeting agenda
Lessons Learned while Deploying OneDrive Sync
2020 July Office 365 AI news for the Midwest AI Group (MAIG)
June 2020 Office 365 Adoption User Group meeting agenda
May 2020 Office 365 Adoption User Group Meeting Agenda
M365 The Tour Israel: Deploying OneDrive Sync
April 2020 Office 365 Adoption Users Group meeting agenda
Overview of Office 365: The Elephant in the Room
Deploying OneDrive Sync

Recently uploaded (20)

PDF
STKI Israel Market Study 2025 version august
PDF
WOOl fibre morphology and structure.pdf for textiles
PPTX
Web Crawler for Trend Tracking Gen Z Insights.pptx
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
DOCX
search engine optimization ppt fir known well about this
PPTX
Modernising the Digital Integration Hub
PDF
Five Habits of High-Impact Board Members
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
Architecture types and enterprise applications.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
Hybrid model detection and classification of lung cancer
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
STKI Israel Market Study 2025 version august
WOOl fibre morphology and structure.pdf for textiles
Web Crawler for Trend Tracking Gen Z Insights.pptx
Hindi spoken digit analysis for native and non-native speakers
O2C Customer Invoices to Receipt V15A.pptx
Taming the Chaos: How to Turn Unstructured Data into Decisions
search engine optimization ppt fir known well about this
Modernising the Digital Integration Hub
Five Habits of High-Impact Board Members
observCloud-Native Containerability and monitoring.pptx
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Chapter 5: Probability Theory and Statistics
Module 1.ppt Iot fundamentals and Architecture
Univ-Connecticut-ChatGPT-Presentaion.pdf
Benefits of Physical activity for teenagers.pptx
Architecture types and enterprise applications.pdf
Getting Started with Data Integration: FME Form 101
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Hybrid model detection and classification of lung cancer
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf

Introduction to PowerShell for Office 365 Global Tenant Admins

Editor's Notes

  • #5: Servers, Desktop OS’s, any .NET API, web services, you name it! No Compliling!
  • #6: Who would like another tool in their toolbox? How about the swiss army knife of tools? It will make you a more productive developer!
  • #8: Who here already has installed and PowerShell? Who’s using Server 2003? 2008? Win 2008 – It’s an OS Feature – “servermanagercmd –install PowerShell”
  • #13: Intellisense!
  • #17: begin with a $ Name that Language… Similar to @variables in SQL, apparently also Ruby, PHP. Arrays start at 0
  • #18: Remove $opposite; add write-host; get-item
  • #19: Mention Aliases
  • #21: Get-Member examples
  • #25: Can you imagine trying to do this if this was just text?
  • #29: Get-Help about_flow_control Mention that collections start at 0
  • #37: Single purpose vs multitool
  • #43: Be a tool maker
  • #48: You owe it to yourself to try out PowerShell. It will make you a better developer!