Office 365 – Office Dev PnP PowerShell – Mixing up releases

It’s not often that I work with SharePoint on-premises anymore, but recently I had a look at PnP PowerShell for SharePoint 2013. Office 365 - Office Dev PnP PowerShell - Mixing up releases Microsoft Office 365, Microsoft SharePoint Online, SharePoint 2013 687474703a2f2f692e696d6775722e636f6d2f6c3031686876452e706e67

Today I switched back to SharePoint Online, mixing up the releases for the different platforms. I started to export some sites using get-PnPProvisioningTemplate and I got the following error message:

powershell_ise.exe Information: 0 : 2017-03-20 14:55:48.3702 [Page Contents] [12] [Debug] Code execution scope started 0ms b4990d80-e2e7-43cb-a4d8-d73c0d5a4b8b
powershell_ise.exe Information: 0 : 2017-03-20 14:56:06.5870 [Page Contents] [12] [Debug] Code execution scope ended 18216ms b4990d80-e2e7-43cb-a4d8-d73c0d5a4b8b
powershell_ise.exe Information: 0 : 2017-03-20 14:56:06.5895 [Extraction] [12] [Debug] Code execution scope ended 48910ms b4990d80-e2e7-43cb-a4d8-d73c0d5a4b8b
Get-PnPProvisioningTemplate : The remote server returned an error: (403) Forbidden.
At C:\Workspace\Triad PnP Framework\Triad.FrameWork\Triad.FrameWork.Provisioning\Modules\TriadModules\Modules\Triad.PowerShell.PnPTemplates\Triad.PowerShell.PnPTemplates.psm1:77 char:21
+ … Get-PnPProvisioningTemplate -Web $web -Out “$path\Templat …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Get-PnPProvisioningTemplate], WebException
+ FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.GetProvisioningTemplate

The nice thing about PnP PowerShell is that you can interchange the templates or at least almost between the on-premises versions of SharePoint and SharePoint Online.

As I worked with SharePoint 2013 recently I installed the 2013 version of PnP PowerShell and of course today I didn’t install the Online version of PnP PowerShell.

Once I got the right version of PnP installed the error message disappeared.

So how do you check  version you have installed?

Within your PowerShell window run

Get-Module

Then all modules loaded will be listed.Office 365 - Office Dev PnP PowerShell - Mixing up releases Microsoft Office 365, Microsoft SharePoint Online, SharePoint 2013 getmodule

If you work with SharePoint online you should make sure that you have the following included in the results:

Binary     2.13.17… SharePointPnPPowerShellOnline       {Add-PnPContentType, Add-PnPContentTypeToDocumentSet, Add-PnPContentTypeToList, Add-PnPCustomAction…}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 4,912 other subscribers

Recent Posts

Archive

Thank you for visiting SharePains

%d bloggers like this: