SharePoint Advanced Management
Developer and PowerShell

Powershell For Data Access Governance

In brief

The documentation now explains how to generate SharePoint and OneDrive permission reports for Microsoft 365 or Microsoft Entra security groups using Microsoft Graph PowerShell. It documents the 100-group limit, supported inputs, report fields, and reporting limitations.

What SharePoint admins need to know

Administrators can use this guidance to identify sites and OneDrive accounts accessible to groups. Reports require Group.Read.All and should be reviewed for invalid entries and groups with no data.

Summaries are generated from the documentation change itself.

Documentation change

The comparison below shows only the changed extract. Use the full-page view for complete context.

Generate a user permission state report

While the site permission report for the entire organization helps you understand the current state of permissions in the entire tenant, some scenarios require discovering sites accessible to a given user. For more information, see Get your organization's site permissions baseline with the snapshot reportDiscover sites accessible by a user or group with the snapshot report. The following section describes how data access governance helps you generate such a user report by using PowerShell. To report on groups instead, see Generate a group permission state report.

First, fetch the UPN or User principal name of the user for whom you want to generate the report by using the Get-MgUser command. Then run the following PowerShell command, which triggers the report listing SharePoint sites accessible to those users.

Start-SPODataAccessGovernanceInsight -ReportEntity PermissionsReport -ReportType Snapshot -Workload OneDriveForBusiness -Name "UserOneDriveReport" -UserEmailList "[email protected]","[email protected]"


## Generate a group permission state report

Use a group permission state report to discover sites accessible to Microsoft 365 groups or Microsoft Entra security groups. SharePoint groups and distribution lists aren't supported as report inputs. Each report contains either users or groups, not both, and a group report can include up to 100 groups.

Use the Microsoft Graph PowerShell SDK to retrieve the groups. Connect to Microsoft Graph with permission to read groups:

```powershell
Connect-MgGraph -Scopes "Group.Read.All"

Retrieve the groups with Get-MgGroup, then pass the returned group objects directly to the TargetGroups parameter. The following example generates a report for the groups with the display name Finance Owners:

$groups = Get-MgGroup -Filter "displayName eq 'Finance Owners'"

Start-SPODataAccessGovernanceInsight `
    -ReportEntity PermissionsReport `
    -ReportType Snapshot `
    -Workload SharePoint `
    -Name "GroupPermissionsReport" `
    -TargetGroups $groups

To list OneDrive accounts accessible to the groups, use -Workload OneDriveForBusiness instead.

The report shows whether the entire site is shared with each group and the count of items shared directly with the group. It doesn't include indirect-permission counts or expand permissions inherited through nested-group membership. For more information, see Discover sites accessible by a user or group with the snapshot report.

Review user and group report results

Review all fields in your generated report to avoid missing information about inputs that couldn't be included. Use the following command to check user and group permission reports:

Get-SPODataAccessGovernanceInsight -ReportEntity PermissionsReport

The report results include the following fields:

FieldDescription
UserPrincipalNamesUsers for whom permission data was generated, identified by user principal name. Applies to user reports.
TargetGroupNamesGroups for whom permission data was generated, identified by display name. Applies to group reports.
InvalidEntriesInputs that couldn't be found in the directory.
EntriesWithNoDataUsers or groups that exist in the directory but have no permission data.

Generate a report on sites and files shared via special SharePoint groups

The site permission reports tell you which sites are overshared. To find the exact items where the special groups "Everyone except external users" (EEEU) or "Everyone" are the recipients, generate this report. For more information about the report and how to interpret its output, see [Get item-level permission details for "Everyone except external users" and "Everyone"](data-access-governance-detailed-eeeu-everyone-permissions-report)Get item-level permission details for "Everyone except external users" and "Everyone".