/images/profilepic.jpeg

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.

Create a folder structure in SharePoint using PowerShell (from file shares)

 

Recently, I had to create a SharePoint folder structure extracted from a file share. I only wanted the structure, and not the files.

So I had the local part to extract what I needed, and then I thought “sure I’ll use PowerShell PnP with a foreach loop, and done!” Well, surprisingly (or not), that didn’t work as expected 😟 So after a few hours trying and trying again, I decided to ask for help… (Never be afraid to ask for help, because you’ll 100% learn something!)

Changing Teams privacy settings from Private to Public. What to expect?

 

When creating a Microsoft Teams team, you can choose Private, Public, or even Org-wide. For the purpose of this blog post, we’re going to talk about Private and Public teams.
 

Create a Private Team

So, I create a Teams, set it up as Private, and add only one member.

As we know, when creating a Microsoft Teams, a SharePoint site is automatically created as well, and the membership should reflect what’s in Teams. Meaning nobody else than those 2 users can access the Team, nor the SharePoint site.

Create a new Team using the Teams Admin Center

 

With the new Microsoft Teams admin center, administrators can control policies, tenant-wide settings, and also create Teams directly.
 

Create a Team from the Admin Center

First thing first, log into the Office 365 portal, then access the Teams admin center (left pane). Under the “Teams” section, click on “+ New team

/images/microsoft365-screenshots/create-team-using-tac-img1.png
 

Fill the info for your new team:

  • a Name
  • a Description
  • Choose the privacy (Private or Public)

Then, click on “Create team“.