Tag Archives: PowerShell

Update SharePoint Site Title: GUI vs PowerShell

If you need to update a SharePoint site title (site name) programmatically (e.g. with PowerShell), and if this site is a group-based site (e.g. Microsoft Teams team site or Viva Engage community site or…) – you should not update SharePoint site title, but you should update group display name instead. Here is why. In Microsoft […]

Using Microsoft.Graph PowerShell to Search in Microsoft 365

There is a Microsoft.Graph PowerShell module provided by Microsoft which simplifies usage of Microsoft Graph API. Below is how to authenticate to MS Graph and how to search within SharePoint and Teams Microsoft 365 content using Microsoft.Graph PowerShell module. Authentication Interactive authentication code sample: For daemon app authentication we need a certificate configured in Azure […]

Search through Microsoft 365 SharePoint from code

Below is how do I search Microsoft 365 content programmatically from PowerShell using MS Graph API, PowerShell PnP, Microsoft Graph module, MSAL library being authenticated as user or daemon application. Let me focus on SharePoint content here but you can use the same technique to search through other Microsoft 365 services. Also, I’ll be using […]

Massive Microsoft 365 groups update with PowerShell

What if you need to bulk update Microsoft 365 groups membership e.g. to add a group owner or member for tens of thousands m365 groups? Iterating through groups one-by-one is unproductive and could take days. Can we do it faster? Here is what I found. In my case, it was Microsoft 365 ownerless groups policy […]

How to create an old document in SharePoint

Sometimes, mostly during PoC or testing policies like retention policy or lifecycle policy you would need some documents created and updated weeks, months or even years ago. But if you create or upload a document in SharePoint library – it will be just a regular new document. So, how to get old documents in the […]

Manage Microsoft 365 groups membership with PowerShell and Graph API

As SharePoint or Teams admin you manage Microsoft 365 groups (create, update, delete, manage membership etc.) having your admin role activated. I prefer PowerShell 7 and Microsoft.Graph PowerShell module, and I need an Azure registered app with “Group.ReadWrite.All” Microsoft Graph API delegated permission. Some findings: If a user was not a group member or group […]

Sites.Selected API permissions for SharePoint access

Sites.Selected permissions are required for the non-interactive applications to get access to a specific SharePoint site using Microsoft Graph API and/or SharePoint API.(Since Microsoft announced EOL of SharePoint App-only service principals, Sites.Selected is the only option going forward). Below are Brief overview of Sites.Selected Historically, we utilized so called SharePoint app-only service principals to get […]

SPO Site LastContentModifiedDate vs LastItemModifiedDate vs LastItemUserModifiedDate vs Graph LastModifiedDateTime

How do we know when the SharePoint site was last updated? We have multiple “when the site was modified last time” properties – e.g. some we can retrieve with SharePoint CSOM: Also we can get On the other hand – we can view and modify site in multiple ways – visit site home page, open […]