Showing posts with label SharePoint Online. Show all posts
Showing posts with label SharePoint Online. Show all posts

March 3, 2026

How to Audit Specific User Permissions Across All SharePoint Online Sites Using PowerShell

Introduction

Managing user access in SharePoint Online can be challenging – especially when you want to audit permissions for specific users across all site collections.

We use a PowerShell script:

  • Retrieves permissions for multiple users
  • Identifies direct and group-based permissions
  • Scan all accessible SharePoint sites
  • Exports results to an Excel (.xlsx) report

We will guide you step by step on how to configure and run the script.

Overview of the blog in image - Managing SharePoint Online User Permissions with PowerShell

Pre-Requisites:

  1. Admin Credentials:

    You must login using a SharePoint Administrator account.

  2. Azure AD Application Details

    Collect the following values from the Azure AD App Registration:

    • Client ID
    • Tenant ID
  3. Permission to All SharePoint Sites

    Only site you can access will return data.

  4. Users.csv File

    The file contains the list of user email addresses you want to check

    Example Users.csv

    User Email csv file image
  5. Script and CSV File in the Same Folder.

    • GetSpecificUsersPermission.ps1
    • Users.csv

Configure the Script:

  • Open the GetSpecificUsersPermission.ps1 file and update:
  • AdminSiteURL → your admin URL
  • https://yourtenant-admin.sharepoint.com
  • Client ID → your registered application’s Client ID
  • Tenant ID → your Azure AD Tenant ID
  • CSV file name if you changed it.

PowerShell Script: GetSpecificUsersPermission.ps1


# Parameters
$AdminSiteURL = "https://yourtenant-admin.sharepoint.com"
$ClientId = "ClientId"
$TenantId = "TenantId"
$usersCSV = "users.csv"

# Get the folder where this script is located
$scriptFolder = $PSScriptRoot

$ReportOutput = Join-Path -Path $scriptFolder -ChildPath "SpecificUsersPermissionReport.csv"

$UsersCsvPath = Join-Path -Path $scriptFolder -ChildPath $usersCSV

Write-Host "CSV will be saved to: $ReportOutput"
Write-Host "Reading users from: $UsersCsvPath"

$UsersToCheck = Import-Csv -Path $UsersCsvPath | Select-Object -ExpandProperty UserEmail

# Connect to Admin Center
$AdminConnection = Connect-PnPOnline -Url $AdminSiteURL -ClientId $ClientId `
-Tenant $TenantId -Interactive -ReturnConnection

# Get all site collections
$Sites = Get-PnPTenantSite -Connection $AdminConnection

$Results = @()

foreach ($Site in $Sites) {
	Write-Host "Processing site: $($Site.Url)" -ForegroundColor Cyan

	# Connect to the actual site
	$SiteConnection = Connect-PnPOnline -Url $Site.Url -ClientId $ClientId `
	-Tenant $TenantId

	# Get the root web and role assignments
	$Web = Get-PnPWeb -Connection $SiteConnection -Includes `
	RoleAssignments, HasUniqueRoleAssignments

	Get-PnPProperty -ClientObject $Web -Property RoleAssignments

	foreach ($RoleAssignment in $Web.RoleAssignments) {

		Get-PnPProperty -ClientObject $RoleAssignment -Property `
		RoleDefinitionBindings, Member

		# Direct user
		if ($RoleAssignment.Member.PrincipalType -eq "User") {

			$UserEmail = ($RoleAssignment.Member.LoginName -split '\|')[-1]

			if ($UsersToCheck -contains $UserEmail) {

				$Results += [PSCustomObject]@{
					SiteURL           = $Site.Url
					UserOrGroupName   = $RoleAssignment.Member.Title
					Type              = "Direct User"
					PermissionLevels  = ($RoleAssignment.RoleDefinitionBindings |
										  Select -ExpandProperty Name) -join ", "
				}
			}
		}

		# SharePoint Group
		elseif ($RoleAssignment.Member.PrincipalType -eq "SharePointGroup") {

			try {
				$Group = Get-PnPGroup -Identity $RoleAssignment.Member.Title `
				-Includes Users -Connection $SiteConnection

				foreach ($User in $Group.Users) {

					$UserEmail = ($User.LoginName -split '\|')[-1]

					if ($UsersToCheck -contains $UserEmail) {

						$Results += [PSCustomObject]@{
							SiteURL           = $Site.Url
							UserOrGroupName   = $User.Title
							Type              = "User (via Group: $($RoleAssignment.Member.Title))"
							PermissionLevels  = ($RoleAssignment.RoleDefinitionBindings |
												  Select -ExpandProperty Name) -join ", "
						}
					}
				}
			}
			catch {
				Write-Warning "Cannot access group $($RoleAssignment.Member.Title) in site $($Site.Url). Skipping."
			}
			finally {
				if ($SiteConnection) {
					Disconnect-PnPOnline -Connection $SiteConnection
				}
			}
		}
	}
}

if ($AdminConnection) {
	Disconnect-PnPOnline
}

# Export results to CSV
$Results | Export-Csv -Path $ReportOutput -NoTypeInformation

Write-Host "Report generated successfully at $ReportOutput"
	

How to Run the Script:

  1. Open PowerShell
  2. Navigate to your script folder:

    Cd “C:\YourFolder”

  3. Run the script:

    .\GetSpecificUsersPermission.ps1

  4. Enter your admin credentials
  5. Complete browser authentication
  6. Wait for the report to be generated

Output Report:

The script generates an Excel report containing:

  • Site URL
  • User Email
  • Direct Permissions
  • Group memberships
  • Role definitions
  • Permission levels

You will find the .xlsx report in the same folder as the script

Conclusion:

This approach gives SharePoint administrators a quick and efficient way to:

  • Audit Permissions.
  • Verify access.
  • View direct & group permissions.
  • Export clean reports for governance.
  • Just update the script, run it and your Excel report is ready.

If you have any questions you can reach out our SharePoint Consulting team here .

February 5, 2026

How to Filter SharePoint Online News Posts in Communication Sites (Step-by-Step Guide)

Introduction

SharePoint Online's News feature has become an essential tool for internal communications, helping organizations share updates, announcements, and stories across their workforce. However, as your news content grows, a common challenge emerges: how do you keep everything organized and ensure employees see only the most relevant information?

Imagine your communication site displaying a mix of company-wide announcements, departmental updates, project reports, and blog posts all in one feed. While comprehensive, this approach can overwhelm users and make it difficult to find specific types of content. Department heads want to see only their team's updates, project managers need quick access to status reports, and employees looking for blog content don't want to scroll through unrelated announcements.

The solution is to filter your News web part by category. By organizing your news posts into distinct types such as:

  • Blogs
  • Departmental updates
  • Project news
  • Company announcements
  • Status reports

You can create targeted news sections that display exactly what your audience needs to see.

In this guide, we'll show you how to filter SharePoint News using the Page Category field—a fully Microsoft-supported method that leverages page properties. This approach requires no custom development, works across multiple sites, and gives you complete control over how news content is organized and displayed throughout your SharePoint environment.

Example of a filtered SharePoint News web part displaying categorized content

Why Use SharePoint Online to Filter News?

You benefit from filtering:

  • Show only relevant News posts.
  • Organize content by categories.
  • Create sections for your blog.
  • Maintain a clean communication site.
  • Improve information discoverability.

You may filter News on any page by using information like Page Category.

Requirements

Before you begin, ensure you have:

  • A SharePoint communication site
  • Site owner or administrator permissions
  • Permission to modify the Site Pages library
  • At least a few news posts already created (for testing the filter)

Step 1: Establish a Page Category Column in the Site Pages Library

  1. Navigate to your Communication Site.
  2. Select Site contents.
  3. Access Site Pages, hover over it to see visible ellipses, then click on it to see “Setting.”
Site Pages → ellipses (…) → Settings
  1. Click Create column and select Choice as the type.
  2. Label the column as "Page Category".
  3. Add choice values such as:
    • Blog
    • Project Report
    • Status Report
    • General News
    • General Page
    • Announcement
    • News
  4. If you want to set a default value, select one; otherwise, leave it blank.
  5. Click the "OK" button to create the column.
Enter the column name, select Choice as the type, add the choice values, set the default value, and click OK.

Important: this column should be established within the Site Pages library – not within any other list or library.

Step 2: Categorize Your News Posts using Page Category

Every News post needs to have a category assigned for filtering purposes.

  1. Open any News Post.
  2. Select Page details (located at the top-right).
  3. Scroll down to page category.
  4. Pick a value (for instance, blog).
  5. Save your changes (the page will auto-save) or republish if already published.
Go to Site Pages, select the page, click the top-right corner icon to open Page Details, and update the Page Category value.

Step 3: Add the SharePoint News Web Part to Your Page

Navigate to the page where you wish to show filtered News.

  1. Select Edit.
  2. Click on the plus sign.
  3. Search for News.
  4. Integrate the News web part.
  5. Choose your preferred format (tiles, list, carousel, etc.).

Note: If you have already been on your communication site, then skip the few steps.

Step 4: Apply Filters to the News Web Part Based on Page Category

  1. Modify your page.
  2. Highlight the News web part.
  3. Select the Edit web part option (pencil symbol).
Click the Edit icon to update the news property.
  1. Scroll down to Filter.
  2. Pick Page properties.
See the filter and select the “Page Properties” filter option.
  1. In the Property name section, choose: Page category.
For Property Name, select the property named “Page Category.”
  1. In the value input field, type or select: Blog.
Select the values; currently, only “Blog” is selected.
  1. Implement changes.
  2. Publish the page.

Now, the News web part will exclusively show entries labeled as “blogs.

Step 5: Create a Blog Section Utilizing News Filtering (optional)

You can establish a specific blog page by using this filtered News web part.

Example Configuration:

  • Page category = Blog

The news web part was adjusted to display solely blog entries.

Here we get the result: after publishing the page, only “Blog” shows; nothing else appears.

Unique banner, design, and navigation links.

This provides a comprehensive blog experience within SharePoint Online.

Step 6: Scale Across Multiple Sites (Reusing the Page Category Column)

Once you've successfully set up filtered news on one communication site, you'll likely want to implement the same categorization system across other sites in your organization. The good news: you don't need to recreate the Page Category column from scratch each time.

SharePoint allows you to convert your custom column into a reusable Site Column that can be added to any communication site. This ensures consistency in how news is categorized across your entire SharePoint environment and saves significant setup time.

Benefits of Using Site Columns

  • Maintain consistent categorization across all sites
  • Save time by avoiding repetitive column creation
  • Ensure all sites use the same category values
  • Make updates to categories in one place

How to Create and Reuse the Page Category Site Column

Part A: Convert to Site Column (on your original site)

  1. Navigate to Site Settings on your source communication site.
  2. Under Web Designer Galleries, select Site columns.
  3. Click Create.
  4. Enter the column name: Page Category.
  5. Select type: Choice.
  6. Add your choice values (Blog, Announcement, Project News, etc.).
  7. Choose an appropriate group or create a new one (e.g., "Custom News Columns").
  8. Click OK to save.

Part B: Add Site Column to Other Sites

  1. Navigate to the target communication site where you want to use filtering.
  2. Go to Site contents.
  3. Open Site Pages library settings.
  4. Click Add from existing site columns.
  5. Locate and select Page Category from the appropriate group.
  6. Click Add, then OK.

The Page Category column is now available on the new site with all the same options you configured originally. You can immediately begin categorizing news posts and setting up filtered News web parts following Steps 2-4 from this guide.

Pro Tip: If you need to add new category values later, update the Site Column definition, and the changes will be reflected across all sites using that column.

Frequently Asked Questions (FAQs)

Can I filter SharePoint Online News by category?

Yes, you can filter SharePoint Online News by creating a Page Category column in the Site Pages library and applying it as a filter in the News web part.

What is the Page Category column in SharePoint?

The Page Category column is a custom metadata field added to the Site Pages library that helps categorize news posts such as blogs, announcements, and project updates.

Is filtering SharePoint News using Page Properties supported by Microsoft?

Yes, using Page Properties like Page Category for filtering the News web part is fully supported by Microsoft in SharePoint Online.

Can I reuse the Page Category column across multiple SharePoint sites?

Yes, by creating a Site Column, you can reuse the Page Category column across different communication sites for consistent filtering.

Can I create a blog section in SharePoint using the News web part?

Yes, by filtering the News web part with Page Category set to “Blog,” you can create a dedicated blog section within SharePoint Online.

Does filtering affect existing news posts?

No, existing news posts will appear once you assign them a Page Category value.

Conclusion

Filtering SharePoint Online News using the Page Category column is a powerful yet simple way to organize content and deliver targeted updates to users. By leveraging page properties and the News web part’s built-in filtering capabilities, organizations can create structured blog sections, department-specific news areas, and cleaner communication sites.

This approach is fully supported by Microsoft, scalable across multiple sites, and improves content discoverability without requiring custom development.

With proper categorization in place, SharePoint News becomes a more effective communication tool for your organization.

July 31, 2025

Automating Flow Duplication in Power Automate for New SharePoint Site Creations

Introduction:

Setting up workflows in Power Automate can take a lot of time, especially when the same workflows need to be recreated every time a new SharePoint site is created. 

Instead of manually creating the same workflows repeatedly, you can automate the process. This means that whenever a new SharePoint site is created, the necessary workflows are automatically duplicated and configured without any manual intervention. 

In this blog, we will walk through the steps to automatically duplicate Power Automate flows whenever a new SharePoint site is created.

Use case:

One of our clients required that a specific Power Automate flow be automatically replicated whenever a new SharePoint site was created. Manually duplicating the flow each time wasn’t scalable, so we implemented an automated solution. 

Architecture Overview:

Here's a high-level overview of the automation process: 

  • Trigger: A new SharePoint site is created. 

  • Retrieve: The definition of the existing (source) flow is fetched. 

  • Update: The flow definition is modified to align with the new site’s parameters. 

  • Recreate: A new flow is created from the modified definition and assigned to the new site.


Step-by-Step Guide to Automating Workflow Duplication

Step 1: Detect New Site Creation

Add a trigger that detects when a new SharePoint site is created.

Step 2: Get the Source Flow(Template Flow)

Use the Power Automate Management connector. 

Add the action "Get Flow" to retrieve the definition of the existing (template) flow. 

This action returns a JSON object containing the flow’s full definition, including triggers, actions, and metadata. 




Step 3: Get Flow Definition and Modify Site-Specific Values

You will now modify the values in the flow definition to suit the new site. 

Update the flow definition retrieved from the "Get Flow" action by replacing the template’s Site URL and List Name or Library ID with the values from the newly created SharePoint site. 

In Power Automate, this is typically accessed using dynamic content like

string(body('Get_Flow')?['properties']['definition'])

 


Step 4: Get All Connection References

Use the "Select" action to format the connection references by mapping fields like connectionName, id, and source from the connectionReferences array, These will be used when creating the new flow.

 

 

Step 5: Create New Flow in Target Environment

Use the "Create Flow" action from the Power Automate Management connector to create the new flow using the modified definition and updated connection references.

Environment Name: Choose your environment

Flow Display Name: Provide a unique name

Flow Definition: Pass the modified JSON definition from Step 3

Flow State: Set this to control whether the flow is turned on/off after creation

connectionReferences: Pass the formatted connection references from Step 4



Conclusion:

This blog demonstrated how to automate the creation of workflows in Power Automate by duplicating an existing flow. By implementing this automation, you can eliminate repetitive manual setup each time a new SharePoint site is created. This approach not only saves time and reduces the chance of errors but also ensures consistency across all sites.


If you have any questions you can reach out our SharePoint Consulting team here.

July 3, 2025

Flexible Sections in SharePoint: Customize Modern Pages with Responsive Layouts

Introduction

Modern SharePoint has transformed how organizations build intranet pages, team sites, and communication platforms. One standout feature that significantly boosts design flexibility and visual layout is Flexible Sections. Introduced as an enhancement to the modern page editing experience, flexible sections allow for more customized, responsive, and user-centric design. 


What Are Flexible Sections in SharePoint?

Flexible sections are an improvement over traditional one, two, or three-column layouts. They enable page authors to: 

  • Mix different column widths 
  • Nest web parts within columns more creatively 
  • Use vertical section alignment 
  • Adapt content for multiple screen sizes more effectively 

Example Layouts: 

  • 70/30 or 30/70 (instead of fixed 50/50) 
  • Left-heavy or right-heavy content 
  • One large section with two smaller columns beneath it 

 

Key Features

1. Custom Column Widths

Unlike the standard section layouts that lock you into preset column sizes, flexible sections allow for more granular control. Want a 66/34 layout? - You can do that. 

2. Improved Responsiveness

Flexible sections adapt more cleanly on mobile and tablet views, ensuring your content remains readable and well-structured across devices. 

3. Better Design Flow

You can now match branding or content flow requirements more easily. Want to highlight a large image on the left and a text box with a button on the right? - Easy. 

4. Integration with Existing Web Parts

Flexible sections work seamlessly with modern SharePoint web parts—like Quick Links, Hero, Image, or News—offering more freedom in arranging them. 

 

How to Add a Flexible Section

  1. Go to the SharePoint page you want to edit. 
  2. Click Edit at the top right corner. 
  3. Hover over the area where you want to add a section, then click the + icon. 
  4. Choose Flexible from the section layout options. 

  5. Add your desired web parts and resize them based on your layout needs (e.g., 2, 3, or 5 columns). 

  6. Adjust the height of the flexible section manually by dragging the resize handle located at the bottom-right corner of the section. This helps you control the vertical spacing to better fit your content. 

  7. Once done, click Save or Republish the page. 

Tip: Combine flexible sections with full-width sections to create visually impactful pages that guide users' attention effectively. 

When to Use Flexible Sections

  • Landing Pages: Great for homepage layouts where you need hero banners, quick links, and announcements in various arrangements. 
  • Team Sites: Align team tools and updates in a clean, user-friendly way. 
  • Internal Communications: Combine visuals and text to improve engagement. 

 

Limitations to Consider

While flexible sections offer powerful capabilities, there are a few things to keep in mind: 

  • Not supported in classic pages – Only available in modern SharePoint pages. 
  • Too many custom sections can clutter – Use them purposefully; don’t overload the page with too many designs. 
  • Some third-party web parts might not fully support flexible layouts. 

 

Final Thoughts

  • Flexible sections in SharePoint are a game changer for organizations seeking more control over their page design without needing to code. By using them smartly, you can build beautiful, engaging, and functional pages that users will actually enjoy navigating. 
  • Start experimenting with flexible layouts today to see how they can elevate your SharePoint experience!  


If you have any questions you can reach out our SharePoint Consulting team here.