Get likes and comments count on SharePoint pages using PowerShell

Today, we’re going to play a bit with SharePoint Online pages, and try to get the number of Likes & Comments we have for each page within a Site Collection. Without further due, let’s get started! Get likes and comments count for all pages on a Site It might be useful to get get a report as to how your pages are performing, and you can get this with PowerShell.

Block file download in OneDrive For Business

When you share a file from your OneDrive for Business, maybe you don’t want recipients to download the file? In today’s short post, that’s what we are going to do! Share a file and block the download To share a file, you can select your file, and click on the ellipses (…), then click on Share Once the pop-up window opens, click on the permissions box, and choose your permission model.

Modify the quick launch in SharePoint using PowerShell

There are some useful cmdlets in the PnP PowerShell module that one wouldn’t think about using, but coupled with a set of other cmdlets, they can be very useful! In today’s blog post, we’ll take the example of the Quick Launch. We can add, remove, or even change the name of a list / library by using PowerShell. And when I said earlier coupled with other cmdlets, we’ll create lists & document libraries too!

Get files with specific names in SharePoint using PowerShell

It’s not uncommon for companies to be wanting an inventory of files / folders in SharePoint. But we can also narrow down the request, and look for only specific documents? In this blog post, we’ll have a look at how to retrieve all the documents with particular name(s), from a Site. Maybe you have a naming convention for files / folders, and therefore, it’s easier to target. Current documents in a Site As a proof (although technically, you can only take my word for it), I’ll run a script to check ALL the documents I have in my site… In the image below, we can see that I have multiple documents, on different document libraries.

Create folders in OneDrive For Business using PowerShell

A few years back, I needed to create folders in OneDrive for Business in preparation for a migration. And as PowerShell PnP (Patterns & Practices) didn’t exist, I used CSOM (Client Side Object Model). Now that we have PowerShell PnP, we can accomplish so much with only a few lines of code, and it’s more “admin-friendly“. In this blog post, we are going to see the process of creating folders in OneDrive for Business, and also what I call “clean up after yourself”.

Share SharePoint sites with specific domains only

Sharing with external users (outside your organisation) has never been easier with SharePoint Online. A good business case could be the use of Extranet sites. You have business partners you wish to collaborate with, securely and quickly, without the hassle of settings up a complex infrastructure. In this blog post, we’ll look at setting up a SharePoint Online site collection sharing settings for external users but only for specific domain(s).

Create custom permissions for multiple Sites using PowerShell

It might be useful from time to time, and depending on the business requirements, to create custom permissions in SharePoint. Best practice would want to copy (or duplicate) a default permission already in SharePoint (and not modify any built-ins), and then add/remove whatever you don’t need. In this blog post, we are going to use SharePoint PowerShell PnP to create custom permissions for multiple Sites in SharePoint Online. Before… For brand new sites, this is what we’ve got as built-in permissions under Site Permissions –> Permission Levels (in the ribbon):

Get files bigger than 50MB in SharePoint using PowerShell

Recently, I had a request to find every files in a specific SharePoint Online site that are 50Mb or bigger. Which I thought “this should be straight forward with conditions in my script“. Well, turned out it wasn’t that straight forward after all. And I needed to be a bit “creative”. When using the PowerShell PnP module, a few outputs are either not the ones you expect, or the type is different.