pnp / pnp/cli-microsoft365

New command: `spo file roleassignment list`

Open
#6,191 6 comments 0 reactions 1 assignee View on GitHub

@nanddeepn is already working on this.

Since May 7, 2026.

good first issue keep-open new feature work in progress
Dominant language
TypeScript
Stars
1.5k
Forks
413
Avg merge
5d 6h
Merged PRs (30d)
21

Description

Usage

m365 spo file roleassignment list [options]

Description

Lists all role assignments from a specific file

Options
Option Description
-u, --webUrl <webUrl> URL of the site where the file is located.
--fileUrl [fileUrl] The server- or site-relative decoded URL of the file. Specify either fileUrl or fileId but not both.
-i, --fileId [fileId] The UniqueId (GUID) of the file. Specify either fileUrl or fileId but not both.
Examples

List all role assignments of a file specified by URL

m365 spo file roleassignment list --webUrl "https://contoso.sharepoint.com/sites/Marketing" --fileUrl "/Branding/Logos/Contoso.jpg"

List all role assignments of a file specified by ID

m365 spo file roleassignment list --webUrl "https://contoso.sharepoint.com/sites/Marketing" --fileId "04796e10-cb5f-4aa3-a438-bc06028a9073"
Default properties
  • PrincipalId
  • Member/Title
  • RoledefinitionBindings/Name (comma-separated)
Additional Info
API request
GET https://contoso.sharepoint.com/sites/Marketing/_api/Web/GetFileByServerRelativePath(decodedUrl='/sites/Marketing/Branding/Logos/Contoso.jpg')/ListItemAllFields/RoleAssignments?$expand=Member,RoleDefinitionBindings&$select=*,Member,RoleDefinitionBindings

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.