SharePoint Online and PowerShell?

Slides:



Advertisements
Similar presentations
SharePoint 2010 Client Side Object Model. Agenda Introduction The Problem Client side vs Server Side Client Side Object Model – How it works – What can.
Advertisements

Getting Started with SharePoint 2013 Apps
Leveraging Enterprise Library in Your Applications Keith Elder Quicken Loans Manager, Sr. Software Engineer Microsoft MVP Keith a t keithelder dot net.
Microsoft SharePoint 2013 SharePoint 2013 as a Developer Platform
Thank you SPSKC15 sponsors!. SharePoint 2013 Search Service Application (SSA) Ambar Nirgudkar Software Engineer
Microsoft ® Official Course Introducing Apps for SharePoint SharePoint Practice Microsoft SharePoint 2013.
Presented by: Bryant O’Hara and Tyler Bithell B2B Technologies B2B TECHNOLOGIES | PRESENTATION Working Magic with PowerShell and CSOM for OneDrive.
©2012 Microsoft Corporation. All rights reserved..
Web FOCUS Integration with Microsoft Office SharePoint By: Kelvin Ruiz NASA – Kennedy Space Center.
Intro to Apps Minnesota SharePoint User Group Raymond April 2014.
OnBase Module Deployment
Sharepoint Portal Server Basics. Introduction Sharepoint server belongs to Microsoft family of servers Integrated suite of server capabilities Hosted.
Winter Consolidated Server Deployment Guide for Hosted Messaging and Collaboration version 3.5 Philippe Maurent Principal Consultant Microsoft.
Introduction to SharePoint Development with VS2010 Paul Yuknewicz Lead Program Manager
INTRODUCTION TO WEB DATABASE PROGRAMMING
EDUCATION YOU CAN TRUST ® Windows SharePoint Services Course Review Review provided by: DNS Computing Services, LLC
Module 8 Configuring and Securing SharePoint Services and Service Applications.
TechEd /22/2017 5:40 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Chapter 18: Windows Server 2008 R2 and Active Directory Backup and Maintenance BAI617.
Agenda Principal Consultant, SharePoint Development Team Lead John Ramminger Linked In:
SharePoint 2010 Development Environment A Guide to Setup SharePoint 2010 Development Environment on Windows 7 Machine.
Office 365 Platform Flexible Tools Understand different provisioning options and their advantages and disadvantages…
Terry Henry IS System Manager, SharePoint SME Micron Technology Inc.
Database-Driven Web Sites, Second Edition1 Chapter 5 WEB SERVERS.
Microsoft SharePoint Server 2010 for the Microsoft ASP.NET Developer Yaroslav Pentsarskyy
Module 4 : Installation Jong S. Bok
POWERSHELL SHENANIGANS KIERAN JACOBSEN HP ENTERPRISE SERVICES.
Upgrading Projects to Visual Studio 2010 Upgrading Projects to SharePoint 2010 Integrating with SharePoint 2010.
Section 11: Implementing Software Restriction Policies and AppLocker What Is a Software Restriction Policy? Creating a Software Restriction Policy Using.
Online Conference June 17 th and 18 th SharePoint Online Administration with PowerShell.
What's New in Kinetic Calendar 2.0 Jack Boespflug Kinetic Data.
What’s New in SharePoint 2010 SharePoint 2010 Development Primer New Developer Tools for SharePoint 2010 SharePoint 2010 Integration with PowerShell.
Mirek Sztajno SQL Server Security PM
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
Intro to Datazen.
SharePoint Online Migration API and Improvements
Windows 8 Application Microsoft Word with an app for Office Internal O365 SharePoint Site Windows Azure Web Sites Windows Azure Workflow Service.
UNDERSTANDING YOUR OPTIONS FOR CLIENT-SIDE DEVELOPMENT IN OFFICE 365 Mark Rackley
Office 365: SharePoint Online 31 May | SharePoint Saturday Calgary – 31 MAY 2014 About Me – Jason Kaczor
Microsoft ® Official Course Module 6 Managing Software Distribution and Deployment by Using Packages and Programs.
Both Dutch and Swedish nationality 20+ years of industry experience Living in Stockholm, Sweden MCSM, MCM, MVP, MCSE, MCSD, MCSA, MCPD, MCITP, MCTS PnP.
Office 365: Attack of the Clones! Building reusable site templates with the Office 365 PnP Framework.
Modern Development Technologies in SharePoint SHAREPOINT SATURDAY OMAHA APRIL, 2016.
Software services delivering SharePoint, Mobile, and Business Intelligence solutions Understanding and implementing the remote provision pattern in SharePoint.
Inspirirani ljudima. Ugasite mobitele. Hvala.. Paolo Pialorsi Senior Consultant PiaSys ( Publishing apps for SharePoint 2013 on Microsoft.
Ontolica Fusion 4.0 The easy Automation Tool for SharePoint Steen Jakobsen Fusion Principal Architect
Martina Grom MVP Office 365 How to (remote) control Office 365 with Azure Toni Pohl MVP Client Dev
Trimantra Software Solution Offshore Software Development Outsourcing Company Visit :
Managing Office 365 Identities and Requirements.
A Developer’s Introduction to SharePoint 2013 Apps Ryan McIntyre, MCITP, MCPD National
Powering up your Office 365 cmdlets with CSOM Bjoern H Rapp, Senior Architect Public Cloud, SopraSteria.
This image was selected is show placement and can be replaced with another full slide image. The Amazing World of PowerShell with SharePoint Online (and.
Start-SPPowerShell – Introduction to PowerShell for SharePoint Admins and Developers Paul BAker.
From SharePoint to Office 365 Development
Office PowerShell administration
Automate Custom Solutions Deployment on Office 365 and Azure
Visual Studio Tools for Office 2005
Microsoft SharePoint Server 2016
Upgrading from Full Trust Code to Add-in Model and SharePoint Framework Paolo Pialorsi Senior Consultant - PiaSys.com Track: DEV | Level:
Excel Services Deployment and Administration
SPFx – A modern development tool for SharePoint
SharePoint Cloud hosted Apps
SharePoint Saturday Omaha April 2016
Office 365 PowerShell Jeremy Sublett.
Getting started with SharePoint Framework
Introduction to SharePoint Framework
SharePoint 2019 Overview and Use SPFx Extensions
SharePoint services Provides team collaboration through SharePoint Sites and makes it easy for communities to work together on documents, tasks, contacts,
PowerShell + SharePoint Online – An Admins Guide to Administration in the O365 Cloud Marrell Sanders – Sr. SharePoint Administrator NACS Branson, MO.
PowerShell + SharePoint Online – An Admins Guide to Administration in the O365 Cloud Marrell Sanders – Sr. SharePoint Administrator SharePoint Saturday.
Presentation transcript:

SharePoint Online and PowerShell? Yes, you can! Joseph Ackerman, Dell Inc. joseph_ackerman@dell.com

About Me Based here in Silicon Valley Almost 30 years of development experience, 2/3 of it as a consultant on the Microsoft Stack The last 9 years have been mostly SharePoint development for organizations like eBay Fidelity Investments Applied Technologies Verisign The State of Montana Bank of America Currently a member of Dell Services ( joseph_ackerman@dell.com )

Agenda Scripting On-Premises vs. Scripting Online Introducing the Office Developers Patterns and Practices Libraries Preparing to Script SharePoint Online Software Requirements Credential Options Code and Demos Reporting and Making Changes to SharePoint Online with PowerShell Resources

Scripting On-Premises vs. Scripting Online

Scripting On-Premises You must have access to the underlying physical or virtual servers The script must run on the server itself You must be logged in with a high level of permissions on the server You must set the execution policy to allow scripts to run Your scripts may need to be signed if the system administrator or organizational policy requires it You need to have access to the SharePoint PowerShell Snap-In and include it in your scripts You must have a permission level in SharePoint that is high enough to accomplish the tasks you are attempting in your script code (this is also true in SharePoint Online)

Scripting Online We have no access to the underlying servers The good news is we can run from any computer with the right software installed and an Internet connection We have to use client-side code and libraries No special policy settings are necessary All we need are Office 365 credentials with the appropriate permissions It’s obvious but since we are logging in with our O365 credentials, we need to make sure that they have permission to complete the tasks that we are attempting with our scripts We can consume the same SharePoint client libraries used by .NET and JavaScript

Microsoft provides *some* cmdlets Office 365 Cmdlets for administrative tasks Creating sites Removing sites Adding users Creating groups Etc. https://technet.microsoft.com/en- us/library/fp161364.aspx

Thankfully OfficeDevPnP is working on the rest PnP Cmdlets to manage artifacts in sites Lists Views Fields Upload files Etc. https://github.com/OfficeDev/PnP- PowerShell/blob/master/Documentation/re adme.md

Introducing the Office Developers Patterns and Practices Libraries

What is OfficeDevPnP? A Microsoft-sponsored Community Project Note: “sponsored”, not “supported”, it’s all open source, available on GitHub Originally formed by a group of consultants working on the transformation of development practices from SharePoint On-Premises to SharePoint Online Transforming SharePoint full Trust Code Solutions to the add-in model An open source community effort with both internal (Microsoft) and external contributors.  Not directly linked with the official Patterns and Practices team at Microsoft Everyone involved is a volunteer, they all have their day jobs (as they are fond of reminding me…) They have an official slide:

Sharing is caring… http://aka.ms/OfficeDevPnP Themes Code samples Guidance documentation Monthly community calls Case Studies Themes SharePoint add-ins Microsoft Graph, Office 365 APIs etc. Remote provisioning Client side development http://aka.ms/OfficeDevPnP

OfficeDevPnP Cmdlets Architecture The Microsoft SharePoint Client DLLs are the foundation of all remote communications with SharePoint Online. Written in C#, the OfficeDevPnP.Core.DLL encapsulates much of the plumbing and setup required to write remote code against SharePoint Online sites. Much of the functionality is written as extension methods to familiar SharePoint objects (Web, List, etc.), making it very easy for developers to use Also written in C#, the OfficeDevPnP Cmdlets module uses the Core.DLL and brings much of its functionality to PowerShell scripters

Available cmdlets Add-SPOContentType Get-SPOAuditing Get-SPOWebPartProperty Remove-SPOWikiPage Add-SPOContentTypeToDocumentSet Get-SPOAuthenticationRealm Get-SPOWebPartXml Remove-SPOWorkflowDefinition Add-SPOContentTypeToList Get-SPOAzureADManifestKeyCredentials Get-SPOWebTemplates Remove-SPOWorkflowSubscription Add-SPOCustomAction Get-SPOContentType Get-SPOWikiPageContent Request-SPOReIndexList Add-SPOEventReceiver Get-SPOContext Get-SPOWorkflowDefinition Request-SPOReIndexWeb Add-SPOField Get-SPOCustomAction Get-SPOWorkflowSubscription Resume-SPOWorkflowInstance Add-SPOFieldFromXml Get-SPODocumentSetTemplate Import-SPOAppPackage Send-SPOMail Add-SPOFieldToContentType Get-SPOEventReceiver Import-SPOTaxonomy Set-SPOAppSideLoading Add-SPOFile Get-SPOFeature Import-SPOTermGroupFromXml Set-SPOAuditing Add-SPOFolder Get-SPOField Import-SPOTermSet Set-SPOContext Add-SPOHtmlPublishingPageLayout Get-SPOFile Install-SPOSolution Set-SPODefaultColumnValues Add-SPOIndexedProperty Get-SPOGroup New-SPOGroup Set-SPODefaultContentTypeToList Add-SPOJavaScriptBlock Get-SPOGroupPermissions New-SPOList Set-SPODocumentSetField Add-SPOJavaScriptLink Get-SPOHealthScore New-SPOPersonalSite Set-SPOFileCheckedIn Add-SPOListItem Get-SPOHomePage New-SPOProvisioningTemplateFromFolder Set-SPOFileCheckedOut Add-SPOMasterPage Get-SPOIndexedPropertyKeys New-SPOTenantSite Set-SPOGroup Add-SPONavigationNode Get-SPOJavaScriptLink New-SPOTermGroup Set-SPOGroupPermissions Add-SPOPublishingPage Get-SPOList New-SPOUser Set-SPOHomePage Add-SPOPublishingPageLayout Get-SPOListItem New-SPOWeb Set-SPOIndexedProperties Add-SPOTaxonomyField Get-SPOMasterPage Remove-SPOContentType Set-SPOList Add-SPOUserToGroup Get-SPOProperty Remove-SPOContentTypeFromDocumentSet Set-SPOListItem Add-SPOView Get-SPOPropertyBag Remove-SPOContentTypeFromList Set-SPOListPermission Add-SPOWebPartToWebPartPage Get-SPOProvisioningTemplate Remove-SPOCustomAction Set-SPOMasterPage Add-SPOWebPartToWikiPage Get-SPOSearchConfiguration Remove-SPOEventReceiver Set-SPOMinimalDownloadStrategy Add-SPOWikiPage Get-SPOSite Remove-SPOField Set-SPOPropertyBagValue Add-SPOWorkflowDefinition Get-SPOSitePolicy Remove-SPOFieldFromContentType Set-SPOSearchConfiguration Add-SPOWorkflowSubscription Get-SPOSiteSearchQueryResults Remove-SPOFile Set-SPOSitePolicy Apply-SPOProvisioningTemplate Get-SPOStoredCredential Remove-SPOGroup Set-SPOTaxonomyFieldValue Connect-SPOnline Get-SPOSubWebs Remove-SPOIndexedProperty Set-SPOTenantSite Convert-SPOProvisioningTemplate Get-SPOTaxonomyItem Remove-SPOJavaScriptLink Set-SPOTheme Disable-SPOFeature Get-SPOTaxonomySession Remove-SPOList Set-SPOTraceLog Disconnect-SPOnline Get-SPOTenantSite Remove-SPOListItem Set-SPOUserProfileProperty Enable-SPOFeature Get-SPOTermGroup Remove-SPONavigationNode Set-SPOWeb Ensure-SPOFolder Get-SPOTheme Remove-SPOPropertyBagValue Set-SPOWebPartProperty Execute-SPOQuery Get-SPOTimeZoneId Remove-SPOTenantSite Set-SPOWikiPageContent Export-SPOTaxonomy Get-SPOUserProfileProperty Remove-SPOUserFromGroup Stop-SPOWorkflowInstance Export-SPOTermGroupToXml Get-SPOView Remove-SPOView Uninstall-SPOAppInstance Find-SPOFile Get-SPOWeb Remove-SPOWeb Uninstall-SPOSolution Get-SPOAppInstance Get-SPOWebPart Remove-SPOWebPart

‘Old school’ PowerShell Using CSOM code in PowerShell is convoluted and repetitive Building a client context $basePath = 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI' Add-Type -Path '$basePath\Microsoft.SharePoint.Client.dll' Add-Type -Path '$basePath\Microsoft.SharePoint.Client.Runtime.dll' $url = 'https://erwinmcm.sharepoint.com/sites/demo' $creds = Get-Credential -Message 'Enter Online Credential' $O365Credential = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($creds.UserName,$creds.Password) $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($url) $ctx.Credentials = $O365Credential # your script

‘New school’ PowerShell Using CSOM code in PowerShell with the PnP Cmdlets is simple Building a client context $url = 'https://erwinmcm.sharepoint.com/sites/demo' Connect-SPOnline -Url $url $ctx = Get-SPOContext # your script

So what do we need?

Software Requirements All of this requires PowerShell version 3 or higher: https://www.microsoft.com/en-us/download/details.aspx?id=34595 (v3) https://www.microsoft.com/en-us/download/details.aspx?id=40855 (v4) https://www.microsoft.com/en-us/download/details.aspx?id=48729 (v5) The SharePoint Server 2013 Client Components SDK: https://www.microsoft.com/en-us/download/details.aspx?id=35585 And the latest PnP PowerShell Commands: In PowerShell v5: Install-Module OfficeDevPnP.PowerShell.V15.Commands Install-Module OfficeDevPnP.PowerShell.V16.Commands For earlier, There are two versions of the commands installer: PnPPowerShellCommands15.msi for SharePoint 2013 on-premises PnPPowerShellCommands16.msi for SharePoint Online / Office 365 Available from https://github.com/officedev/pnp-powershell/releases

Credential Options - Interactive Nothing happens in SharePoint Online without Credentials… They can be entered interactively at run-time This is fine if you are personally monitoring the run of your script Demo Demo creation of stored credentials with Windows Credential Manager

Credential Options – Windows Credential Manager The PnP PowerShell Cmdlets can use generic credentials stored in Windows Credential Manager Conveniently stored on the machine where the script will be run Referred to by a simple label Excellent if you want to run your scripts unattended, for example as part of a timer job Perfect if you are a lazy typist like me  Demo

Demos!

aka.ms/OfficeDevPnP https://aka.ms/OfficeDevPnPVideos https://github.com/OfficeDev/PnP https://github.com/OfficeDev/PnP-Sites-Core https://github.com/OfficeDev/PnP-PowerShell https://github.com/OfficeDev/PnP-Tools https://github.com/OfficeDev/PnP-Guidance https://github.com/OfficeDev/PnP-Transformation https://github.com/OfficeDev/PnP-OfficeAddIns https://github.com/OfficeDev/PnP-Provisioning-Schema https://aka.ms/OfficeDevPnPVideos https://aka.ms/OfficeDevPnPMSDN https://aka.ms/OfficeDevPnPYammer https://docs.com/OfficeDevPnP @OfficeDevPnP https://aka.ms/OfficeDevPnPCall https://aka.ms/OfficeDevPnPPartnerPack