Why do we need to learn PnP PowerShell?

In this ever-changing technology landscape, we should always ask this question while learning something new. Why do I need to learn this? Is it worth investing time and effort in this topic?

Microsoft has already provided cmdlets to manage SharePoint Online for administrative tasks in Office 365, for example, to create a site collection, to delete/remove site collections, adding users, creating groups, and so on. The PnP PowerShell cmdlets are complementary to the SharePoint Online cmdlets. I think the PnP PowerShell cmdlets are developer-focused and provide the means to manage artifacts in SharePoint, such as lists, views, fields, content types, upload files, and so on.

Right now with the June 2017 release, there are more than 150 cmdlets available and the team is working to constantly add new cmdlets. Some cmdlets are duplicated, such as creating site collections and deleting site collections. We have covered PnP PowerShell briefly in Chapter 5, Managing Exchange Online using PowerShell on SharePoint Online.

Now you may be wondering why an administrator needs to learn PnP PowerShell cmdlets if they are developer-focused. The reasons are as follows:

  • Office 365 PnP cmdlets provide an easy and secure way to manage credentials using Windows Credential Manager, and we don't need to hardcode user IDs and passwords in the scripts.
  • When we need to work with the artifacts of SharePoint Online using CSOM, we are effectively using C# code. With PnP PowerShell, we don't need to know C#, and it offers a more PowerShell-like approach to working with SharePoint Online artifacts.
  • We can script the governance logic and provisioning logic without writing C# code.
  • While executing the scripts, we don't need to load the runtime dynamic-link libraries (dlls), for example, Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll.
  • Office 365 is used by thousands of organizations irrespective of size, ranging from a few users to thousands of users. Depending on the size of the organization, sometimes an Office 365 administrator needs to perform tasks that require few developer skills. A good example will be uploading multiple files into a document library to create a new site collection with a predefined template for the publishing/team site.
  • If you have the hybrid deployment of SharePoint, it means you are using SharePoint Online as well as SharePoint on-premises, and PnP PowerShell is available for SharePoint 2013 and SharePoint 2016 on-premises as well. The key difference between the native SharePoint 2013 and SharePoint 2016 PowerShell cmdlets is they are not built for remote management. This means you need direct access to the SharePoint servers to execute these commands. On the other hand, PnP PowerShell cmdlets are built for remote management. Hence, you will use remote management for both SharePoint Online as well as SharePoint on-premises 2013 and 2016.
  • A lot of organizations have blurred lines in terms of responsibilities for administrators and developers. Also, having additional skill helps.
  • Also, in some organizations, because of governance, developers do not have the required access to execute certain PowerShell cmdlets and they rely on administrators to execute them. If you are familiar with the cmdlets, then as an administrator you will feel more comfortable executing scripts provided by the developers.
  • Even though some cmdlets are duplicates, such as creating site collections and deleting site collections since PnP is a community-driven initiative, more and more cmdlets get added almost every month. Right now, there are more than 150 cmdlets in the June 2017 release and by the time you are reading this book, many more new cmdlets will have been added.

If you have a full-fledged development team or your organization/tenant does not use SharePoint Online much, then you can skip this chapter.

By now, if you are convinced that you would like to learn to use PnP PowerShell cmdlets, then let's continue to the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.151.32