Skip to content

New command: 🔐 spo folder roleassignment remove #3701

@Adam-it

Description

@Adam-it

Usage

m365 spo folder roleassignment remove [options]

Description

Removes a role assignment from the specified folder.

Options

Option Description
-u, --webUrl <webUrl> The URL of the site where the folder is located.
-f, --folderUrl <folderUrl> The server- or site-relative URL of the folder.
--principalId [principalId] The SharePoint principal id. It may be either an user id or group id for which the role assignment will be removed. Specify either upn, groupName or principalId but not multiple.
--upn [upn] The upn/email of the user. Specify either upn, groupName or principalId but not multiple.
--groupName [groupName] The Azure AD or SharePoint group name. Specify either upn, groupName or principalId but not multiple.
--confirm [confirm] Don't prompt for confirmation when removing the role assignment.

Examples

Remove the role assignment from the specified folder based on the group name.

m365 spo folder roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --folderUrl "/Shared Documents"  --groupName "saleGroup"

Remove the role assignment from the specified folder based on the principal id.

m365 spo folder roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --folderUrl "/Shared Documents"  --principalId 2

Additional Info

a very similar command was already developed but on listitem level (which is actually the same as folder) so we may probably use that command code as reference to make it easier to create this one
https://pnp.github.io/cli-microsoft365/cmd/spo/listitem/listitem-roleassignment-remove/

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions