Over the past few years, I have been using the PnP PowerShell cmdlets quite regularly. They’re a constant companion in all my projects, and very often they’ve helped me to solve issues, automate tasks, and generally simplify my life. Examples include:

The code was only available on those pages directly, and not stored in any central repository. When I wanted to grab some particular script, I usually went to this blog and searched for it. Not the best way to manage code, so it was time to change this and add it to Github.

As of the writing of this post, I’ve made 10 scripts available in the following repository: https://github.com/modery/PnP-Samples.
They’ve been categorised into scripts for Lists, Items, Permissions, Search, and Sites, and include

  • A script which creates an inventory of the lists and libraries in a site, similar to what’s available in the Site Contents page
  • A script to retrieve all versioning details from all lists in a provided site
  • A script to check all lists in all subsites and verifies if the lists have the three forms (View, Edit, New) set
  • A script to retrieve the permission levels from all site collections
  • A script to set a list of site collection administrators on specified site
  • A script to recursively delete all subsites for a given site and the site itself
  • and more

I will keep on adding more scripts whenever I’ve got something I think could be valuable for others, and I encourage contribution to my repository. Something that could be done better, something that doesn’t work anymore, something that you think should be changed? Pull Requests are welcome!

Leave a Reply

Your email address will not be published.

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