PowerShell Script to Get SharePoint Site Permissions (2025 Guide)
Managing SharePoint permissions manually can be time-consuming and error-prone. That’s why I use PowerShell to quickly extract, audit, and export SharePoint Online site permissions for better management. Here I will explain how to run a PowerShell script to get SharePoint site permissions step by step.
Table of Contents
Why I Use PowerShell to View SharePoint Permissions
If you’re reading this guide, you probably have your reasons to know about PowerShell scripts. But here are my:
- Export permissions into readable formats like CSV
- Identify users and groups with elevated access
- Audit multiple sites in bulk
- Maintain better control and visibility
Manually checking site permissions through the SharePoint UI can be time-consuming. Next, I’ll share the PowerShell scripts which is mentioned on the official Microsoft site, and I tried them.
Prerequisites to Run a PowerShell Script to Get SharePoint Site Permissions Quickly
Here are some prerequisite steps which need to be followed before running any command:
- SharePoint Online Management Shell is installed.
- Global admin or SharePoint admin rights are available.
- Backup SharePoint Online to local storage
- Connect to SharePoint Online using the following command:
PowerShell Script to Get SharePoint Site Permissions
Here’s the basic PowerShell script I use to fetch permission details from a specific SharePoint Online site.
#1. Script to List All Users with Direct Permissions

#2. Export Permissions to CSV
To make the results more usable, export them to CSV using this enhanced script:

#3. Script for All Subsites & Libraries
In larger environments, I loop through all subsites and libraries using PnP PowerShell. Here’s an example:

Best Practices for Auditing SharePoint Permissions
- Find users with Full Control and ensure they really need it.
- Audit external sharing; some guest users may have more access than required.
- Schedule this script monthly using Windows Task Scheduler to keep permissions in check.
- If you’re handling a SharePoint Online tenant-to-tenant migration or restructuring, run this script before and after to validate access changes.
How to Ensure Permissions Stay Intact During SharePoint Migration?
Despite a PowerShell script to get SharePoint site permissions, if you’re planning to migrate SharePoint data between tenants or restructure permissions, it’s easier to combine permission reporting with SysTools SharePoint Online Migration Tool.
It will help to:
- Migrate site content, lists, and libraries with full fidelity
- Retain permissions, metadata, and structure
- Generate pre- and post-migration reports for verification
- 24/7 Technical Support
You can use the tool alongside this PowerShell method to ensure migrated permissions are accurate.
Author’s Verdict
As a SharePoint admin, I know how time-consuming and frustrating it is to manage permissions on multiple sites. That’s why I explained the PowerShell script to get SharePoint site permissions simultaneously, to help those who are like me.
If you’re planning to migrate SharePoint list to another site or tenant, don’t forget to check out SysTools Migrator for a seamless experience.
People Also Ask
Q1. Can I get SharePoint permissions without admin rights?
No, you need SharePoint admin or site collection admin permissions to query roles using PowerShell.
Q2. What’s the difference between direct and inherited permissions?
Direct permissions are explicitly granted; inherited ones come from the parent site. PowerShell can reveal both with proper scripting.
Q3. Is PnP PowerShell better than the default SPO module?
PnP PowerShell is more flexible and suited for site-wide audits or reporting across subsites.
Q4. Can I use these scripts for SharePoint On-Premises?
Yes, but you’ll need to adapt the script to use Microsoft.SharePoint.PowerShell module instead of CSOM.