2. Matti Paukkonen
Modern Workplace Architect
+ 10 years with Microsoft technologies & SharePoint & PowerShell
+ 7 years with cloud
#TeamsFi co-organizer
https://www.linkedin.com/in/matti-paukkonen/
@mpaukkon
https://mattipaukkonen.com
https://github.com/mpaukkon/
4. Why?
• I ❤ PowerShell!
• There are admins who are not familiar with it
• Admin centers are not including all features
• Automation & repetitive tasks
• Bulk operations
• Reusability
• Custom reports
• Community
5. PowerShell modules for Office 365
• When to use what?
• Different connection methods
• Versioning
• Authentication methods
• MFA support
• App Keys & Secret
• Certificate
Exchange Online PowerShell
SPO Management Shell
PnP PowerShell
Skype Online Connector
Teams PowerShell
Azure AD
7. Azure AD PowerShell modules
• Three different modules
• Azure AD PowerShell for Graph → GA and Preview version
Get-AzureADUser
• Microsoft Azure AD Module for Windows PowerShell
Get-MSolUser
• AzureAD module preferred
• Azure AD Preview version required for some management
tasks
• Unified Group Setting
• Usage Guidelines
• Group creation
8. Common tasks for Azure AD
• Setting Office 365 Group (Unified Group)
settings and group creation
• Assigning licenses to users
• Enable sensitivity labels for Teams, Groups &
SharePoint
• Reporting
• Used quite often with other modules
9. Exchange Online PowerShell
• Uses remote session (WinRM)
• Connection URLs on Docs
• MFA support→ download
module from EXO Admin
Center → Edge, IE needed
edge://flags/#edge-click-once
• Connect-EXOPSSSession with
UPN
10. Exchange Online PowerShell V2
• Uses modern authentication
• New cmdlets for for bulk
operations
• Properties, PropertySets,
ResultSizes
• Install/Update from
PowerShell Gallery
• Support for PowerShell Core
and cross-platform in
progress
11. Office 365 Security & Compliance
PowerShell
• MFA supported module from EXO Admin Center
→ Connect-IPPSSession with UPN
• Management of AIP, DLP, retention, compliance
policies, audit logs
• Synchronization of sensitivity labels for Preview
Execute-AzureAdLabelSync
13. SharePoint Online Management Shell
• Example: New-SPOSite
• Connection with Admin URL →
https://<yourtenant>-admin.sharepoint.com
• Requires SharePoint Administrator role
• Updates almost monthly
→ update when you need new features!
• Install/updates from PowerShell Gallery
14. Common tasks with SPO Management
Shell
• Setting up organization assets
• Managing Site Designs and Scripts
• Setting up SharePoint Home site
• Setting up company theme
• Reports
16. SharePoint PnP PowerShell
• Community-driven – SharePoint Patterns & Practises (PnP)
• Support SharePoint Online (and on-premises)→ separate
modules
• Utilizes SharePoint CSOM for operations
• Utilizes PnP templating mechanism for provisioning sites and
content
• Permissions on a level of the context
→ site collection, site, list…
• Install/Update from PowerShell Gallery
17. Common tasks with PnP PowerShell
• Provisioning new site collections with content and metadata
• Complex provisioning solutions
• Bulk operations
• Updating SharePoint User Profiles
18. Trick! PnP PowerShell & Graph API
• You can use PnP PowerShell to get Graph API authentication
token (delegated)
• Connect-PnPOnline –Scopes “Group.ReadWrite.All”
• $token = Get-PnPAccessToken
• $authHeader = @{
'Content-Type'='applicationjson’
'Authorization’=‘Bearer ‘+$token }
19. Skype for Business Online Connector
• Required for, even if TeamsOnly
• Management of different Teams policies
• Reporting user-assigned policies
• Assigning policies to groups
• Combined with/in Teams PowerShell in the future
20. Teams PowerShell module
• Create and manage teams
• Channels
• Tabs
• Users
• Team settings (on Preview)
• Archiving
• Apps
• Permission required on team
level or Teams Service admin
equivalent
• New Policy management
cmdlets on limited Preview
• Policy packages
• User policies
• Policy assignment to groups
21. Common tasks with Teams PowerShell
• Provisioning Teams
• Adding Apps to Teams
• Some migration cases, where conversation are not meaningful
• Reports
22. BONUS: New Graph PowerShell SDK
Preview
• Collection of modules for calling Microsoft Graph API
• Running on PowerShell Core
• Open-source
• Available on PowerShell Gallery
24. Wrap-up
• PowerShell is not scary! You need to learn it
• Keep your scripts simple and reusable
• Build your script library
• docs.microsoft.com is your friend!
• #SharingIsCaring – share your knowledge &
examples
26. Teams Community Finland
Next online meeting 9.3.2020 klo 15
https://www.meetup.com/spugfi/events/266721690/
Jari Tuisku (Microsoft)
Milla Järvi
#TeamsFi | #MSTeamsDev | #SharingIsCaring