Below you will find pages that utilize the taxonomy term “Microsoft Graph”
posts
Managing Microsoft 365 Group Settings with PnP PowerShell and Microsoft Graph
Introduction Managing Microsoft 365 Group settings is crucial for maintaining a compliant and secure environment.PowerShell and Microsoft Graph can be used to configure various group settings, including naming policies, guest access, and more.
As a regular user of PnP PowerShell, I aimed to replicate the functionality of the Microsoft Entra cmdlets for configuring group settings using PnP PowerShell.
Example Script to Update naming policy Settings The following PowerShell script updates the naming group settings using the Microsoft Graph API and PnP PowerShell.
posts
Get Drive ID and Drive Item ID for File for Further Microsoft Graph Operations using PnP PowerShell
Introduction When working with files in SharePoint, the drive ID and drive item ID are essential parameters for further manipulation using Microsoft Graph API. The drive ID is a base64 encoded string composed of the site ID, web ID, and list ID for a particular SharePoint library. For more details, refer to Microsoft Graph: Encoding and decoding the drive ID by Mikael Svenson. The item ID part appears to be a base32 encoding of the SharePoint item’s unique ID, though the exact mechanics are still being explored.
posts
Audit Service Principal Access to SharePoint Sites with Sites.Selected Permissions
Ensuring the security and compliance of your SharePoint environment is crucial, especially when dealing with service principals, Entra ID apps, or federated identities. These entities often have elevated permissions that, if mismanaged, can lead to unauthorized access and potential data breaches. Regularly auditing these permissions is a best practice for maintaining a secure and compliant SharePoint environment.
Application only or granular access to individual site instead of whole tenant, scope called “Sites.
posts
Get Library Drive Id using Power Automate
When using Power Automate with Excel for Business actions, the drive ID for a library is automatically determined. However, if you deploy a Power Automate solution across different environments and use a library as a datasource environment variable, referencing this variable in the flow can result in an error due to an invalid drive ID.
Referencing the variable in the Power Automate flow, it will throw an error message failing to work our the drive id of the library.
posts
Remove Expired Sharing Links and Update Sharing Link Role to Read
Updating the expiration time and role for sharing links is still limited. Although it seems possible through the Graph API Update permission, I have been unable to pass the roles as body parameters.
Graph Explorer Attempts Using the following script:
Invoke-PnPGraphMethod -Url "v1.0/drives/$driveId/items/$driveItemId/permissions/$($ShareLink.Id)" -Method Patch -Content @{ roles = @("read") } threw the error message
“Invalid input: No Information provided to update the specifed permission”
From the UI Anyone link can’t be edited Organisation link can’t be edited Specific people links can be edited Using the network tab from the browser developer tools enables identifying the endpoint to update specific people links only.
posts
Oversight of Sharing Information in SharePoint sites using PowerShell with CSOM, REST and PnP PowerShell
Effective oversight of sharing links and sharing information are paramount to ensuring data security, compliance, and optimal collaboration experiences.
As organisations migrate to M365 environments, they inherit powerful collaboration tools that facilitate seamless sharing of documents and resources. However, without proper governance, these capabilities can lead to unintended consequences such as data breaches, compliance violations, and loss of intellectual property.
Sharing is a powerful feature for collaboration. However depending on how items, files or folders are shared, a sharing link might be created or unique permissions on these items are created.
posts
Retrieving SiteId from Microsoft Graph for Subsequent API Calls
Retrieving SiteId from Microsoft Graph for Subsequent API Calls This post offers an option to retrieve a SiteId from Microsoft Graph using PnP PowerShell. This can be particularly useful when making further API calls that require the SiteId.
$siteurl = "https://contoso.sharepoint.com/sites/Company311" Connect-PnPOnline -url $siteurl -interactive # for the site url https://contoso-admin.sharepoint.com/teams/app-m365 # Extract the domain and site name $uri = New-Object System.Uri($siteurl) $domain = $uri.Host $siteName = $uri.AbsolutePath # Construct the new URL $RestMethodUrl = "v1.
posts
Retrieving SharePoint Site URL for Teams Channels
Retrieving SharePoint Site URL for Teams Channels Have you ever needed to construct the SharePoint site URL for a private or shared channel using just the channel name? This post will guide you through the process.
Private Channels The default SharePoint URL for a private channel follows the format: <ParentSharePointSiteUrl><ChannelRelativeUrl>. Note that if the channel is renamed, the corresponding SharePoint URL remains unchanged.
Shared Channels Similarly, the default SharePoint URL for a shared channel follows the format: <ParentM365GroupName><ChannelRelativeUrl>.