SlideShare a Scribd company logo
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Introduction to
SharePoint Patterns and Practices
(PnP) PowerShell
Theresa Eller
@SharePointMadam | sharepointmadam@gmail.com
sharepointmadam.blogspot.com | slideshare.net/sharepointmadam
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Theresa Eller
1
SharePoint Saturday
sharepointmadam.blogspot.com
Video featured on Webucator’s
YouTube channel
aOS.community
(Azure, Office 365 & SharePoint Community)
@SharePointMadam
#sphelp
Community Involvement
Shay & Cookie
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Agenda
Installing SharePoint PnP
SharePoint PnP
Script - Save Site As Template
Working Through Script Errors
Resources
2
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
3
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
SharePoint Patterns and Practices
Originally formed in 2013 by a group of Microsoft
consultants who were working on the transformation
effort of the Office 365 Dedicated customers to Multi-
Tenant
SharePoint / Office 365 Dev PnP is not directly linked
with the official Patterns and Practices team at Microsoft
Done by the community for the community
4
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
PnP PowerShell Overview
“SharePoint Patterns and Practices (PnP) contains a
library of PowerShell commands (PnP PowerShell) that
allows you to perform complex provisioning and artifact
management actions towards SharePoint. The
commands use CSOM and can work against both
SharePoint Online as SharePoint On-Premises.”
5
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
PowerShellGet
PowerShell module with commands for discovering,
installing, updating and publishing the PowerShell
artifacts like Modules, DSC Resources, Role Capabilities
and Scripts
Is integrated with the PackageManagement module (in
Windows 10) as a provider so that users can also use the
PackageManagement cmdlets for discovering, installing
and updating the PowerShell artifacts like Modules and
Scripts
6
https://github.com/powershell/powershellget
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
PowerShellGet Requirements for Windows 7
Windows PowerShell 3.0 or newer
PackageManagement module
• a.k.a. Windows Management Framework 4.0 (or higher)
PowerShellGet module
7
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
PowerShellGet Installation Steps (1 of 2)
Save the PowerShellGet module to a local directory
• Source: https://github.com/PowerShell/PowerShellGet/releases
Run PowerShell/SPO Management Console with
elevated permissions
Method 1
• Navigate to the local directory
• Import the module
o Import-Module path/to/PowerShellGet/PowerShellGet
8
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
PowerShellGet Installation Steps (2 of 2)
Method 2
• Save-Module PowerShellGet –Path C:LocalFolder
• Delete contents of
$env:ProgramFilesWindowsPowerShellModulesPowerShellGet
 and
$env:ProgramFilesWindowsPowerShellModulesPackageMana
gement folders
• Re-open the PS Console with elevated permissions
• Copy-Item "C:LocalFolderPowerShellGet*"
"$env:ProgramFilesWindowsPowerShellModulesPowerShellGe
t" -Recurse –Force
• Copy-Item "C:LocalFolderPackageManagement*"
"$env:ProgramFilesWindowsPowerShellModulesPackageMana
gement" -Recurse -Force
9
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Installing SharePointPnPPowerShell (1 of 2)
For Windows 7, import PowerShellGet module
then
Windows 7 or 10
• Download the SharePointPnPPowerShell* module to
C:WindowsSystem32WindowsPowerShellv1.0
o June 2017 release
https://github.com/sharepoint/pnp/powershell/releases/tag/2.16.1706.0
• Run PowerShell (or SPO Management Console) as administrator
• Install SharePointPnPPowerShell* module (next slide)
o SharePointPnPPowerShellOnline requires SharePoint Online
Management Shell
10
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Installing SharePointPnPPowerShell (2 of 2)
Import the SharePointPnPSharePoint* module
• Install-Module SharePointPnPPowerShellOnline
• Install-Module SharePointPnPPowerShell2016
• Install-Module SharePointPnPPowerShell2013
11
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Import, Install, Connect
12
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
13
Save Site As Template
A real world experience
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Save Site As Template – Team Site
14
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Save Site As Template – Publishing Site
SharePoint Designer
15
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
16
Script
Variables | Extract | Create | Apply
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Script Variables
$credential = Get-credential
#Define variables
$tenant = "<tentant>";
$sourceSite = "/<relative URL>"; [site template to save]
$targetSite = "/<relative URL>"; [where to build new site]
$subSite = "/<relative URL>"; [new site to build]
$path = "C:PnP<templatename>.xml";
[where to store template]
$siteTitle = "<sitetitle>";
$siteDescription = "<sitedescription>";
$siteUrl = "/<subsite>"; [relative URL of new site]
17
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Get Context (Source Site)
$webUrl = "https://{0}.sharepoint.com{1}/" -f $tenant,
$sourceSite;
Write-Output $("Connecting to {0}..." -f $webUrl);
Connect-PnPOnline -Url $webUrl -Credentials
$credential;
Write-Output "Context obtained";
18
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Connect-PnPOnline
Connects to a SharePoint site and creates a context that
is required for the other PnP Cmdlets
Get-Help Connect-PnPOnline –Examples
Get-Help Connect-PnPOnline –Detailed
19
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Get/Set-PnPContext
Sets the context to use by the cmdlets
• Useful for switching between sites
Connect-PnPOnline –Url $siteAurl –Credentials $Credentials
$ctx = Get-PnPContext
Get-PnPList
Connect-PnPOnline –Url $siteBurl –Credentials $Credentials
Get-PnPList
Set-PnPContext
Get-PnPList
20
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Extract Template
Write-Output "Creating PnP template...";
#Include necessary parameters
Get-PnPProvisioningTemplate -PersistBrandingFiles
-PersistPublishingFiles -IncludeSiteGroups -Out $path;
Write-Output $("Template saved to {0}" -f $path);
21
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Parameters
Get-PnpProvisioningTemplate parameters included in
script
22
Parameter Type Required Description
IncludeSiteGroups SwitchParameter False
If specified all site groups will
be included.
PersistBrandingFiles SwitchParameter False
If specified the files used for
masterpages, sitelogo,
alternate CSS and the files
that make up the composed
look will be saved.
PersistPublishingFiles SwitchParameter False
If specified the files used for
the publishing feature will be
saved.
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Get Context (Target Site)
$webUrl = "https://{0}.sharepoint.com{1}/" -f $tenant,
$targetSite;
Write-Output $("Connecting to {0}..." -f $webUrl);
Connect-PnPOnline -Url $webUrl -Credentials
$credential;
Write-Output "Done";
23
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Create New Sub-site
#Change the Locale ID if necessary
#Change the Site Template if necessary
$web = New-PnPWeb -Title "<sitetitle>" -Url $subSite
-Description "<sitedescription>" -Locale 1033 -Template
"<Site Template>";
or
$web = New-PnPWeb -Title $siteTitle -Url $subSite
-Description $siteDescription -Locale 1033 -Template
"<Site Template>";
24
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Get Context (Sub-site)
$webUrl = "https://{0}.sharepoint.com{1}/" -f $tenant,
$subSite;
Write-Output $("Connecting to {0}..." -f $webUrl);
Connect-PnPOnline -Url $webUrl -Credentials
$credential;
Write-Output "Done";
25
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Turn On TraceLog
Set-PnPTraceLog -on -level debug
26
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Apply Template
Write-Output $("Applying PnP template [{0}] to site [{1}
({2})]..." -f $path, $web.Title, $web.Url);
Apply-PnPProvisioningTemplate -Path $path;
Write-Output "Done";
27
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Disconnect
Disconnect-PnPOnline
28
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
29
Working Through Script Errors
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Site Collection Features
Issue:
• Site collections features that are activated on the source site
collection but not the target site collection can cause applying the
template to fail, with error “Feature with Id <featureID>' is not
installed in this farm, and cannot be added to this scope.”
Example:
• Feature with Id '863b4392-e4a4-460e-ae8d-14c29b14f14a' is not
installed in this farm, and cannot be added to this scope.
Solution:
• Compare the site collection features from the source site
collection to the target site collection
• On the target site collection, activate any site collection features
that are activated on the source site collection
30
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Site Features
Issue:
• Site features that are activated on the source site but not the
target site can cause applying the template to fail, with an error of
feature missing
Solution:
• Compare the site features from the source site to the target site
• On the target site, activate any site features that are activated on
the source site
• In the template XML file, delete the feature that “is not installed in
this farm, and cannot be added to this scope”
31
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Error Updating Field
Updating field 413213c2-3e91-4dc8-9d47-216b83ab8027
failed: The field was found invalid: {{listid:Deliverables}
• Search the Internet for “SharePoint [field ID]”
• Go to the list settings and click on the field to open it
or
• Delete the column or list
o Re-create it manually or let the script re-create it
32
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Content Types (1/2)
Error:
• Referenced content type
0x01010029AB996A778A324EAEF918C866ECBD19 not
available in site or in template
Solution:
• Copy the Content Type ID from the PowerShell window and
search for it in the template
• Delete document-specific content type IDs from the template XML
file
o Happens because content is not copied
from original site to new site
33
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Content Types (2/2)
Resources:
• Content Type IDs
https://msdn.microsoft.com/en-
us/library/office/aa543822(v=office.14).aspx
• Base Content Type Hierarchy
https://msdn.microsoft.com/en-
us/library/office/ms452896(v=office.14).aspx
34
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Source Site Target Site
Default Content Type Not Updated
35
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Can’t Customize Permission Levels (1/2)
Apply-PnPProvisioningTemplate : You cannot customize
permission levels in a web site with inherited permission
levels.
36
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Can’t Customize Permission Levels (2/2)
37
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
All Sitegroups
WARNING: You are requesting to export sitegroups from
a subweb. Notice that ALL sitegroups from the site
collection are included in the result.
38
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Connection Closed by the Server
Get-PnPProvisioningTemplate : The underlying
connection was closed: A connection that was expected
to be kept alive was closed by the server.
39
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Error with Argument (1/2)
The argument must be a single file name and cannot
contain path characters
40
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Error with Argument (2/2)
Trying to create a master page library at the subsite level
• Master pages are stored at the site collection level
• Unnecessary for a subsite
41
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Specified Argument Out of Range
Apply-PnPProvisioningTemplate : Specified argument
was out of the range of valid values.
• Not the Cause: OOTB web part (Newsfeed) was removed from
homepage
42
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Custom Web Parts
Purchased/downloaded from SharePoint Store
Delete code from XML file
43
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Copy File
Copy-PnPFile -SourceUrl
<relativeURL/filename.extension>
-TargetUrl <relative URL>
• Copy site logos and other pictures or files that are needed on
each site
44
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
45
Resources
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Resources
https://dev.office.com/patterns-and-practices
How to get started with Office Dev PnP web cast
SharePoint PnP Webcast – What should SharePoint
Administrators know about SharePoint Framework?
https://github.com/SharePoint/PnP
PnP PowerShell – GitHub repository
SharePoint Online Management Shell
Windows Management Framework
Cmdlet Documentation
47
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Special Thanks To…
Antii K. Koskela (@koskila)
Eric Skaggs (@skaggsej)
Eric Overfield (@ericoverfield)
Erwin van Hunen (@erwinvanhunen)
Nick van Denheuvel
@officedevpnp
48
Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited.
Questions?
Theresa Eller
@SharePointMadam | sharepointmadam@gmail.com
sharepointmadam.blogspot.com | slideshare.net/sharepointmadam

More Related Content

Similar to NJSPUG-Introduction to SharePoint Patterns and Practices PowerShell

NZ Code Camp 2011 PowerShell + SharePoint
NZ Code Camp 2011 PowerShell + SharePointNZ Code Camp 2011 PowerShell + SharePoint
NZ Code Camp 2011 PowerShell + SharePoint
Nick Hadlee
 
Hack proof your drupal site- DrupalCamp Hyderabad
Hack proof your drupal site- DrupalCamp HyderabadHack proof your drupal site- DrupalCamp Hyderabad
Hack proof your drupal site- DrupalCamp Hyderabad
Naveen Valecha
 
AppSphere 2016 - Automate performance testing with AppDynamics using continuo...
AppSphere 2016 - Automate performance testing with AppDynamics using continuo...AppSphere 2016 - Automate performance testing with AppDynamics using continuo...
AppSphere 2016 - Automate performance testing with AppDynamics using continuo...
Brad Stoner
 
Pyramid patterns
Pyramid patternsPyramid patterns
Pyramid patterns
Carlos de la Guardia
 
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...
Eric Overfield
 
Pyramid Deployment and Maintenance
Pyramid Deployment and MaintenancePyramid Deployment and Maintenance
Pyramid Deployment and Maintenance
Jazkarta, Inc.
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
Haiqi Chen
 
Admin share point with powershell
Admin share point with powershellAdmin share point with powershell
Admin share point with powershell
Concentrated Technology
 
Intro to SharePoint + PowerShell
Intro to SharePoint + PowerShellIntro to SharePoint + PowerShell
Intro to SharePoint + PowerShell
Ryan Dennis
 
Django - Python MVC Framework
Django - Python MVC FrameworkDjango - Python MVC Framework
Django - Python MVC Framework
Bala Kumar
 
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
SAP Cloud Platform
 
Accelerating Time To Market with Sitecore & Helix
Accelerating Time To Market with Sitecore & HelixAccelerating Time To Market with Sitecore & Helix
Accelerating Time To Market with Sitecore & Helix
VarunNehra
 
Make the hosting company life easier with SharePoint PowerShell
Make the hosting company life easier with SharePoint PowerShellMake the hosting company life easier with SharePoint PowerShell
Make the hosting company life easier with SharePoint PowerShell
Virtual Affairs
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in Django
Lakshman Prasad
 
Spsatx slides (widescreen)
Spsatx slides (widescreen)Spsatx slides (widescreen)
Spsatx slides (widescreen)
Ryan Dennis
 
Prediction io 架構與整合 -DataCon.TW-2017
Prediction io 架構與整合 -DataCon.TW-2017Prediction io 架構與整合 -DataCon.TW-2017
Prediction io 架構與整合 -DataCon.TW-2017
William Lee
 
Hong kong drupal user group nov 8th - drupal 7.32 security vulnerability
Hong kong drupal user group   nov 8th - drupal 7.32 security vulnerabilityHong kong drupal user group   nov 8th - drupal 7.32 security vulnerability
Hong kong drupal user group nov 8th - drupal 7.32 security vulnerability
Ann Lam
 
Hong kong drupal user group nov 8th - drupal 7.32 security vulnerability
Hong kong drupal user group   nov 8th - drupal 7.32 security vulnerabilityHong kong drupal user group   nov 8th - drupal 7.32 security vulnerability
Hong kong drupal user group nov 8th - drupal 7.32 security vulnerability
Ann Lam
 
Hong Kong Drupal User Group - Nov 8th
Hong Kong Drupal User Group - Nov 8thHong Kong Drupal User Group - Nov 8th
Hong Kong Drupal User Group - Nov 8th
Wong Hoi Sing Edison
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial
之宇 趙
 

Similar to NJSPUG-Introduction to SharePoint Patterns and Practices PowerShell (20)

NZ Code Camp 2011 PowerShell + SharePoint
NZ Code Camp 2011 PowerShell + SharePointNZ Code Camp 2011 PowerShell + SharePoint
NZ Code Camp 2011 PowerShell + SharePoint
 
Hack proof your drupal site- DrupalCamp Hyderabad
Hack proof your drupal site- DrupalCamp HyderabadHack proof your drupal site- DrupalCamp Hyderabad
Hack proof your drupal site- DrupalCamp Hyderabad
 
AppSphere 2016 - Automate performance testing with AppDynamics using continuo...
AppSphere 2016 - Automate performance testing with AppDynamics using continuo...AppSphere 2016 - Automate performance testing with AppDynamics using continuo...
AppSphere 2016 - Automate performance testing with AppDynamics using continuo...
 
Pyramid patterns
Pyramid patternsPyramid patterns
Pyramid patterns
 
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...
 
Pyramid Deployment and Maintenance
Pyramid Deployment and MaintenancePyramid Deployment and Maintenance
Pyramid Deployment and Maintenance
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
 
Admin share point with powershell
Admin share point with powershellAdmin share point with powershell
Admin share point with powershell
 
Intro to SharePoint + PowerShell
Intro to SharePoint + PowerShellIntro to SharePoint + PowerShell
Intro to SharePoint + PowerShell
 
Django - Python MVC Framework
Django - Python MVC FrameworkDjango - Python MVC Framework
Django - Python MVC Framework
 
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
 
Accelerating Time To Market with Sitecore & Helix
Accelerating Time To Market with Sitecore & HelixAccelerating Time To Market with Sitecore & Helix
Accelerating Time To Market with Sitecore & Helix
 
Make the hosting company life easier with SharePoint PowerShell
Make the hosting company life easier with SharePoint PowerShellMake the hosting company life easier with SharePoint PowerShell
Make the hosting company life easier with SharePoint PowerShell
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in Django
 
Spsatx slides (widescreen)
Spsatx slides (widescreen)Spsatx slides (widescreen)
Spsatx slides (widescreen)
 
Prediction io 架構與整合 -DataCon.TW-2017
Prediction io 架構與整合 -DataCon.TW-2017Prediction io 架構與整合 -DataCon.TW-2017
Prediction io 架構與整合 -DataCon.TW-2017
 
Hong kong drupal user group nov 8th - drupal 7.32 security vulnerability
Hong kong drupal user group   nov 8th - drupal 7.32 security vulnerabilityHong kong drupal user group   nov 8th - drupal 7.32 security vulnerability
Hong kong drupal user group nov 8th - drupal 7.32 security vulnerability
 
Hong kong drupal user group nov 8th - drupal 7.32 security vulnerability
Hong kong drupal user group   nov 8th - drupal 7.32 security vulnerabilityHong kong drupal user group   nov 8th - drupal 7.32 security vulnerability
Hong kong drupal user group nov 8th - drupal 7.32 security vulnerability
 
Hong Kong Drupal User Group - Nov 8th
Hong Kong Drupal User Group - Nov 8thHong Kong Drupal User Group - Nov 8th
Hong Kong Drupal User Group - Nov 8th
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial
 

More from Theresa Lubelski

Modern_Site_Owner_M365_Ottawa.pdf
Modern_Site_Owner_M365_Ottawa.pdfModern_Site_Owner_M365_Ottawa.pdf
Modern_Site_Owner_M365_Ottawa.pdf
Theresa Lubelski
 
Inside The Vault: Bridging the Social Distancing Gap with SharePoint and Teams
Inside The Vault: Bridging the Social Distancing Gap with SharePoint and TeamsInside The Vault: Bridging the Social Distancing Gap with SharePoint and Teams
Inside The Vault: Bridging the Social Distancing Gap with SharePoint and Teams
Theresa Lubelski
 
SPS Warsaw - Achieving a Consistent User Experience
SPS Warsaw - Achieving a Consistent User ExperienceSPS Warsaw - Achieving a Consistent User Experience
SPS Warsaw - Achieving a Consistent User Experience
Theresa Lubelski
 
SPS Cincinnati Modern SharePoint Experience
SPS Cincinnati Modern SharePoint ExperienceSPS Cincinnati Modern SharePoint Experience
SPS Cincinnati Modern SharePoint Experience
Theresa Lubelski
 
SPSCLT - The Latest Modern SharePoint Features
SPSCLT - The Latest Modern SharePoint FeaturesSPSCLT - The Latest Modern SharePoint Features
SPSCLT - The Latest Modern SharePoint Features
Theresa Lubelski
 
SPS Nashville Modern Sharepoint Experience
SPS Nashville Modern Sharepoint ExperienceSPS Nashville Modern Sharepoint Experience
SPS Nashville Modern Sharepoint Experience
Theresa Lubelski
 
SPS Nashville Modern Sharepoint Experience
SPS Nashville Modern Sharepoint ExperienceSPS Nashville Modern Sharepoint Experience
SPS Nashville Modern Sharepoint Experience
Theresa Lubelski
 
NACS Mix It Up With Modern SharePoint Sites
NACS Mix It Up With Modern SharePoint SitesNACS Mix It Up With Modern SharePoint Sites
NACS Mix It Up With Modern SharePoint Sites
Theresa Lubelski
 
Mix It Up with Modern SharePoint Sites
Mix It Up with Modern SharePoint SitesMix It Up with Modern SharePoint Sites
Mix It Up with Modern SharePoint Sites
Theresa Lubelski
 
SPSSA - Site Collection Admin
SPSSA - Site Collection AdminSPSSA - Site Collection Admin
SPSSA - Site Collection Admin
Theresa Lubelski
 
SPSLA - You are the Site Collection Admin
SPSLA - You are the Site Collection AdminSPSLA - You are the Site Collection Admin
SPSLA - You are the Site Collection Admin
Theresa Lubelski
 
SPSSAC - SharePoint 101
SPSSAC - SharePoint 101SPSSAC - SharePoint 101
SPSSAC - SharePoint 101
Theresa Lubelski
 
SPSSAC - Taking Content Management Beyond Content Types
SPSSAC - Taking Content Management Beyond Content TypesSPSSAC - Taking Content Management Beyond Content Types
SPSSAC - Taking Content Management Beyond Content Types
Theresa Lubelski
 
SPSHOU SharePoint 2013 Best Practices
SPSHOU SharePoint 2013 Best PracticesSPSHOU SharePoint 2013 Best Practices
SPSHOU SharePoint 2013 Best Practices
Theresa Lubelski
 
SPSSA SharePoint 101 Best Practices
SPSSA SharePoint 101 Best PracticesSPSSA SharePoint 101 Best Practices
SPSSA SharePoint 101 Best Practices
Theresa Lubelski
 
SPSSA SharePoint 101 Best Practices - 3 Slides PP
SPSSA SharePoint 101 Best Practices - 3 Slides PPSPSSA SharePoint 101 Best Practices - 3 Slides PP
SPSSA SharePoint 101 Best Practices - 3 Slides PP
Theresa Lubelski
 
Branson - Taking Content Management Beyond Content Types
Branson - Taking Content Management Beyond Content TypesBranson - Taking Content Management Beyond Content Types
Branson - Taking Content Management Beyond Content Types
Theresa Lubelski
 
Branson - Self-Service Business Intelligence for On-Prem Organizations
Branson - Self-Service Business Intelligence for On-Prem OrganizationsBranson - Self-Service Business Intelligence for On-Prem Organizations
Branson - Self-Service Business Intelligence for On-Prem Organizations
Theresa Lubelski
 
HTF-Taking Content Management Beyond Content Types
HTF-Taking Content Management Beyond Content TypesHTF-Taking Content Management Beyond Content Types
HTF-Taking Content Management Beyond Content Types
Theresa Lubelski
 
Taking Content Management Beyond Content Types - SPS Paris
Taking Content Management Beyond Content Types - SPS ParisTaking Content Management Beyond Content Types - SPS Paris
Taking Content Management Beyond Content Types - SPS Paris
Theresa Lubelski
 

More from Theresa Lubelski (20)

Modern_Site_Owner_M365_Ottawa.pdf
Modern_Site_Owner_M365_Ottawa.pdfModern_Site_Owner_M365_Ottawa.pdf
Modern_Site_Owner_M365_Ottawa.pdf
 
Inside The Vault: Bridging the Social Distancing Gap with SharePoint and Teams
Inside The Vault: Bridging the Social Distancing Gap with SharePoint and TeamsInside The Vault: Bridging the Social Distancing Gap with SharePoint and Teams
Inside The Vault: Bridging the Social Distancing Gap with SharePoint and Teams
 
SPS Warsaw - Achieving a Consistent User Experience
SPS Warsaw - Achieving a Consistent User ExperienceSPS Warsaw - Achieving a Consistent User Experience
SPS Warsaw - Achieving a Consistent User Experience
 
SPS Cincinnati Modern SharePoint Experience
SPS Cincinnati Modern SharePoint ExperienceSPS Cincinnati Modern SharePoint Experience
SPS Cincinnati Modern SharePoint Experience
 
SPSCLT - The Latest Modern SharePoint Features
SPSCLT - The Latest Modern SharePoint FeaturesSPSCLT - The Latest Modern SharePoint Features
SPSCLT - The Latest Modern SharePoint Features
 
SPS Nashville Modern Sharepoint Experience
SPS Nashville Modern Sharepoint ExperienceSPS Nashville Modern Sharepoint Experience
SPS Nashville Modern Sharepoint Experience
 
SPS Nashville Modern Sharepoint Experience
SPS Nashville Modern Sharepoint ExperienceSPS Nashville Modern Sharepoint Experience
SPS Nashville Modern Sharepoint Experience
 
NACS Mix It Up With Modern SharePoint Sites
NACS Mix It Up With Modern SharePoint SitesNACS Mix It Up With Modern SharePoint Sites
NACS Mix It Up With Modern SharePoint Sites
 
Mix It Up with Modern SharePoint Sites
Mix It Up with Modern SharePoint SitesMix It Up with Modern SharePoint Sites
Mix It Up with Modern SharePoint Sites
 
SPSSA - Site Collection Admin
SPSSA - Site Collection AdminSPSSA - Site Collection Admin
SPSSA - Site Collection Admin
 
SPSLA - You are the Site Collection Admin
SPSLA - You are the Site Collection AdminSPSLA - You are the Site Collection Admin
SPSLA - You are the Site Collection Admin
 
SPSSAC - SharePoint 101
SPSSAC - SharePoint 101SPSSAC - SharePoint 101
SPSSAC - SharePoint 101
 
SPSSAC - Taking Content Management Beyond Content Types
SPSSAC - Taking Content Management Beyond Content TypesSPSSAC - Taking Content Management Beyond Content Types
SPSSAC - Taking Content Management Beyond Content Types
 
SPSHOU SharePoint 2013 Best Practices
SPSHOU SharePoint 2013 Best PracticesSPSHOU SharePoint 2013 Best Practices
SPSHOU SharePoint 2013 Best Practices
 
SPSSA SharePoint 101 Best Practices
SPSSA SharePoint 101 Best PracticesSPSSA SharePoint 101 Best Practices
SPSSA SharePoint 101 Best Practices
 
SPSSA SharePoint 101 Best Practices - 3 Slides PP
SPSSA SharePoint 101 Best Practices - 3 Slides PPSPSSA SharePoint 101 Best Practices - 3 Slides PP
SPSSA SharePoint 101 Best Practices - 3 Slides PP
 
Branson - Taking Content Management Beyond Content Types
Branson - Taking Content Management Beyond Content TypesBranson - Taking Content Management Beyond Content Types
Branson - Taking Content Management Beyond Content Types
 
Branson - Self-Service Business Intelligence for On-Prem Organizations
Branson - Self-Service Business Intelligence for On-Prem OrganizationsBranson - Self-Service Business Intelligence for On-Prem Organizations
Branson - Self-Service Business Intelligence for On-Prem Organizations
 
HTF-Taking Content Management Beyond Content Types
HTF-Taking Content Management Beyond Content TypesHTF-Taking Content Management Beyond Content Types
HTF-Taking Content Management Beyond Content Types
 
Taking Content Management Beyond Content Types - SPS Paris
Taking Content Management Beyond Content Types - SPS ParisTaking Content Management Beyond Content Types - SPS Paris
Taking Content Management Beyond Content Types - SPS Paris
 

Recently uploaded

Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 

Recently uploaded (20)

Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 

NJSPUG-Introduction to SharePoint Patterns and Practices PowerShell

  • 1. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Introduction to SharePoint Patterns and Practices (PnP) PowerShell Theresa Eller @SharePointMadam | sharepointmadam@gmail.com sharepointmadam.blogspot.com | slideshare.net/sharepointmadam
  • 2. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Theresa Eller 1 SharePoint Saturday sharepointmadam.blogspot.com Video featured on Webucator’s YouTube channel aOS.community (Azure, Office 365 & SharePoint Community) @SharePointMadam #sphelp Community Involvement Shay & Cookie
  • 3. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Agenda Installing SharePoint PnP SharePoint PnP Script - Save Site As Template Working Through Script Errors Resources 2
  • 4. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. 3
  • 5. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. SharePoint Patterns and Practices Originally formed in 2013 by a group of Microsoft consultants who were working on the transformation effort of the Office 365 Dedicated customers to Multi- Tenant SharePoint / Office 365 Dev PnP is not directly linked with the official Patterns and Practices team at Microsoft Done by the community for the community 4
  • 6. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. PnP PowerShell Overview “SharePoint Patterns and Practices (PnP) contains a library of PowerShell commands (PnP PowerShell) that allows you to perform complex provisioning and artifact management actions towards SharePoint. The commands use CSOM and can work against both SharePoint Online as SharePoint On-Premises.” 5
  • 7. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. PowerShellGet PowerShell module with commands for discovering, installing, updating and publishing the PowerShell artifacts like Modules, DSC Resources, Role Capabilities and Scripts Is integrated with the PackageManagement module (in Windows 10) as a provider so that users can also use the PackageManagement cmdlets for discovering, installing and updating the PowerShell artifacts like Modules and Scripts 6 https://github.com/powershell/powershellget
  • 8. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. PowerShellGet Requirements for Windows 7 Windows PowerShell 3.0 or newer PackageManagement module • a.k.a. Windows Management Framework 4.0 (or higher) PowerShellGet module 7
  • 9. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. PowerShellGet Installation Steps (1 of 2) Save the PowerShellGet module to a local directory • Source: https://github.com/PowerShell/PowerShellGet/releases Run PowerShell/SPO Management Console with elevated permissions Method 1 • Navigate to the local directory • Import the module o Import-Module path/to/PowerShellGet/PowerShellGet 8
  • 10. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. PowerShellGet Installation Steps (2 of 2) Method 2 • Save-Module PowerShellGet –Path C:LocalFolder • Delete contents of $env:ProgramFilesWindowsPowerShellModulesPowerShellGet and $env:ProgramFilesWindowsPowerShellModulesPackageMana gement folders • Re-open the PS Console with elevated permissions • Copy-Item "C:LocalFolderPowerShellGet*" "$env:ProgramFilesWindowsPowerShellModulesPowerShellGe t" -Recurse –Force • Copy-Item "C:LocalFolderPackageManagement*" "$env:ProgramFilesWindowsPowerShellModulesPackageMana gement" -Recurse -Force 9
  • 11. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Installing SharePointPnPPowerShell (1 of 2) For Windows 7, import PowerShellGet module then Windows 7 or 10 • Download the SharePointPnPPowerShell* module to C:WindowsSystem32WindowsPowerShellv1.0 o June 2017 release https://github.com/sharepoint/pnp/powershell/releases/tag/2.16.1706.0 • Run PowerShell (or SPO Management Console) as administrator • Install SharePointPnPPowerShell* module (next slide) o SharePointPnPPowerShellOnline requires SharePoint Online Management Shell 10
  • 12. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Installing SharePointPnPPowerShell (2 of 2) Import the SharePointPnPSharePoint* module • Install-Module SharePointPnPPowerShellOnline • Install-Module SharePointPnPPowerShell2016 • Install-Module SharePointPnPPowerShell2013 11
  • 13. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Import, Install, Connect 12
  • 14. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. 13 Save Site As Template A real world experience
  • 15. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Save Site As Template – Team Site 14
  • 16. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Save Site As Template – Publishing Site SharePoint Designer 15
  • 17. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. 16 Script Variables | Extract | Create | Apply
  • 18. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Script Variables $credential = Get-credential #Define variables $tenant = "<tentant>"; $sourceSite = "/<relative URL>"; [site template to save] $targetSite = "/<relative URL>"; [where to build new site] $subSite = "/<relative URL>"; [new site to build] $path = "C:PnP<templatename>.xml"; [where to store template] $siteTitle = "<sitetitle>"; $siteDescription = "<sitedescription>"; $siteUrl = "/<subsite>"; [relative URL of new site] 17
  • 19. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Get Context (Source Site) $webUrl = "https://{0}.sharepoint.com{1}/" -f $tenant, $sourceSite; Write-Output $("Connecting to {0}..." -f $webUrl); Connect-PnPOnline -Url $webUrl -Credentials $credential; Write-Output "Context obtained"; 18
  • 20. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Connect-PnPOnline Connects to a SharePoint site and creates a context that is required for the other PnP Cmdlets Get-Help Connect-PnPOnline –Examples Get-Help Connect-PnPOnline –Detailed 19
  • 21. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Get/Set-PnPContext Sets the context to use by the cmdlets • Useful for switching between sites Connect-PnPOnline –Url $siteAurl –Credentials $Credentials $ctx = Get-PnPContext Get-PnPList Connect-PnPOnline –Url $siteBurl –Credentials $Credentials Get-PnPList Set-PnPContext Get-PnPList 20
  • 22. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Extract Template Write-Output "Creating PnP template..."; #Include necessary parameters Get-PnPProvisioningTemplate -PersistBrandingFiles -PersistPublishingFiles -IncludeSiteGroups -Out $path; Write-Output $("Template saved to {0}" -f $path); 21
  • 23. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Parameters Get-PnpProvisioningTemplate parameters included in script 22 Parameter Type Required Description IncludeSiteGroups SwitchParameter False If specified all site groups will be included. PersistBrandingFiles SwitchParameter False If specified the files used for masterpages, sitelogo, alternate CSS and the files that make up the composed look will be saved. PersistPublishingFiles SwitchParameter False If specified the files used for the publishing feature will be saved.
  • 24. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Get Context (Target Site) $webUrl = "https://{0}.sharepoint.com{1}/" -f $tenant, $targetSite; Write-Output $("Connecting to {0}..." -f $webUrl); Connect-PnPOnline -Url $webUrl -Credentials $credential; Write-Output "Done"; 23
  • 25. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Create New Sub-site #Change the Locale ID if necessary #Change the Site Template if necessary $web = New-PnPWeb -Title "<sitetitle>" -Url $subSite -Description "<sitedescription>" -Locale 1033 -Template "<Site Template>"; or $web = New-PnPWeb -Title $siteTitle -Url $subSite -Description $siteDescription -Locale 1033 -Template "<Site Template>"; 24
  • 26. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Get Context (Sub-site) $webUrl = "https://{0}.sharepoint.com{1}/" -f $tenant, $subSite; Write-Output $("Connecting to {0}..." -f $webUrl); Connect-PnPOnline -Url $webUrl -Credentials $credential; Write-Output "Done"; 25
  • 27. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Turn On TraceLog Set-PnPTraceLog -on -level debug 26
  • 28. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Apply Template Write-Output $("Applying PnP template [{0}] to site [{1} ({2})]..." -f $path, $web.Title, $web.Url); Apply-PnPProvisioningTemplate -Path $path; Write-Output "Done"; 27
  • 29. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Disconnect Disconnect-PnPOnline 28
  • 30. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. 29 Working Through Script Errors
  • 31. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Site Collection Features Issue: • Site collections features that are activated on the source site collection but not the target site collection can cause applying the template to fail, with error “Feature with Id <featureID>' is not installed in this farm, and cannot be added to this scope.” Example: • Feature with Id '863b4392-e4a4-460e-ae8d-14c29b14f14a' is not installed in this farm, and cannot be added to this scope. Solution: • Compare the site collection features from the source site collection to the target site collection • On the target site collection, activate any site collection features that are activated on the source site collection 30
  • 32. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Site Features Issue: • Site features that are activated on the source site but not the target site can cause applying the template to fail, with an error of feature missing Solution: • Compare the site features from the source site to the target site • On the target site, activate any site features that are activated on the source site • In the template XML file, delete the feature that “is not installed in this farm, and cannot be added to this scope” 31
  • 33. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Error Updating Field Updating field 413213c2-3e91-4dc8-9d47-216b83ab8027 failed: The field was found invalid: {{listid:Deliverables} • Search the Internet for “SharePoint [field ID]” • Go to the list settings and click on the field to open it or • Delete the column or list o Re-create it manually or let the script re-create it 32
  • 34. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Content Types (1/2) Error: • Referenced content type 0x01010029AB996A778A324EAEF918C866ECBD19 not available in site or in template Solution: • Copy the Content Type ID from the PowerShell window and search for it in the template • Delete document-specific content type IDs from the template XML file o Happens because content is not copied from original site to new site 33
  • 35. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Content Types (2/2) Resources: • Content Type IDs https://msdn.microsoft.com/en- us/library/office/aa543822(v=office.14).aspx • Base Content Type Hierarchy https://msdn.microsoft.com/en- us/library/office/ms452896(v=office.14).aspx 34
  • 36. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Source Site Target Site Default Content Type Not Updated 35
  • 37. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Can’t Customize Permission Levels (1/2) Apply-PnPProvisioningTemplate : You cannot customize permission levels in a web site with inherited permission levels. 36
  • 38. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Can’t Customize Permission Levels (2/2) 37
  • 39. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. All Sitegroups WARNING: You are requesting to export sitegroups from a subweb. Notice that ALL sitegroups from the site collection are included in the result. 38
  • 40. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Connection Closed by the Server Get-PnPProvisioningTemplate : The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. 39
  • 41. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Error with Argument (1/2) The argument must be a single file name and cannot contain path characters 40
  • 42. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Error with Argument (2/2) Trying to create a master page library at the subsite level • Master pages are stored at the site collection level • Unnecessary for a subsite 41
  • 43. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Specified Argument Out of Range Apply-PnPProvisioningTemplate : Specified argument was out of the range of valid values. • Not the Cause: OOTB web part (Newsfeed) was removed from homepage 42
  • 44. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Custom Web Parts Purchased/downloaded from SharePoint Store Delete code from XML file 43
  • 45. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Copy File Copy-PnPFile -SourceUrl <relativeURL/filename.extension> -TargetUrl <relative URL> • Copy site logos and other pictures or files that are needed on each site 44
  • 46. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. 45 Resources
  • 47.
  • 48. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Resources https://dev.office.com/patterns-and-practices How to get started with Office Dev PnP web cast SharePoint PnP Webcast – What should SharePoint Administrators know about SharePoint Framework? https://github.com/SharePoint/PnP PnP PowerShell – GitHub repository SharePoint Online Management Shell Windows Management Framework Cmdlet Documentation 47
  • 49. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Special Thanks To… Antii K. Koskela (@koskila) Eric Skaggs (@skaggsej) Eric Overfield (@ericoverfield) Erwin van Hunen (@erwinvanhunen) Nick van Denheuvel @officedevpnp 48
  • 50. Confidential and Proprietary Information – Property of PinnacleART. Any attempt to procure, use or disclose is strictly prohibited. Questions? Theresa Eller @SharePointMadam | sharepointmadam@gmail.com sharepointmadam.blogspot.com | slideshare.net/sharepointmadam