Skip to main content
Valto — Keep ahead of tomorrow

News

SharePoint PnP Powershell Tools – Automating SharePoint

Microsoft has just updated the PnP tools for SharePoint Online and On Premise. These tools give you much greater control over your deployments (especially SP Online) for example some of the cmdlets available are as follows, Lists New-PnPList - Creates a new list Add‑PnPListItem - Adds an item to a l…

SharePoint
Published
17 February 2017
SharePoint Online Square Microsoft Partner

Automating SharePoint with PnP Powershell Tools

Microsoft has just updated the PnP tools for SharePoint Online and On Premise. These tools give you much greater control over your deployments (especially SP Online) for example some of the cmdlets available are as follows,

  • Lists
    • New-PnPList – Creates a new list
    • Add‑PnPListItem – Adds an item to a list
    • Set‑PnPListItem – Updates a list item
  • Content Types
    • Add‑PnPContentType – Adds a new content type
    • Get‑PnPContentType – Retrieves a content type
  • Branding
    • Add‑PnPNavigationNode – Adds a menu item to either the quicklaunch or top navigation
    • Set‑PnPTheme – Sets the theme of the current web.
    • Set‑PnPMasterPage – Sets the default master page of the current web.

A full list of all the available cmdlets can be found on Microsoft’s Powershell overview page.

These cmdlets are a brilliant way to provide automation components and integration with various applications. For example these could be used to automatically create a SharePoint site based on a template. Valto use this internally to create a SharePoint site for each customer once we add them to our Finance/CRM Package.

To get started with the scripts you can download them from GitHub.

People that are using Windows 10, a better way would be to use the Windows Management Framework and run the command below (For SharePoint Online)

https://msdn.microsoft.com/en-us/pnp_powershell/pnp-powershell-overview

Once you’re all setup its a matter of running the typical Powershell commands to get connected to your tenant as below,

Connect-PnPOnline –Url https://yoursite.sharepoint.com –Credentials (Get-Credential)

The URL above explains all of the cmdlets that are available.

Over the coming weeks Valto will be building some example automation scripts that may be useful to your SharePoint deployments including some of the examples below,

  • Full creation of a SharePoint Site, sub sites and lists. This may be useful for building demo environments.
  • Automatically applying branding packages to various subsites.
  • Creating reusable lists for forms and workflow processes you may have.

If you have any questions about the scripts or would like to see some specific automation scripts let me know in the comments section below.

Talk to our team

Share this

Related reading

NewsSharePoint

Mastering Document Control with SharePoint

Struggling with document versioning, policy visibility or outdated files? Learn how Valto’s SharePoint-based Controlled Documents Solution solves the most common document control challenges.

7 May 2025

Atlassian Server is end of life
NewsSharePoint

Atlassian Server is End of Life

Is your organisation still using Confluence on an unsupported version? Discover the benefits of migrating to SharePoint Online, including better security, cost savings, and seamless integration with Office 365.

22 January 2025