spo list roleassignment remove
Removes a role assignment from list permissions
Usage
m365 spo list roleassignment remove [options]
Options
-u, --webUrl <webUrl>URL of the site where the list is located.
-i, --listId [listId]ID of the list. Specify either
listId,listTitle, orlistUrlbut not multiple.-t, --listTitle [listTitle]Title of the list. Specify either
listId,listTitle, orlistUrlbut not multiple.--listUrl [listUrl]Relative URL of the list. Specify either
listId,listTitle, orlistUrlbut not multiple.--principalId [principalId]SharePoint ID of principal it may be either user id or group id you want to remove permissions. Specify either
principalId,upn,groupName,entraGroupId, orentraGroupName.--upn [upn]The upn/email of user. Specify either
principalId,upn,groupName,entraGroupId, orentraGroupName.--groupName [groupName]The group name of the SharePoint group. Specify either
principalId,upn,groupName,entraGroupId, orentraGroupName.--entraGroupId [entraGroupId]ID of the Microsoft Entra group. Specify either
principalId,upn,groupName,entraGroupId, orentraGroupName.--entraGroupName [entraGroupName]Display name of the Microsoft Entra group. Specify either
principalId,upn,groupName,entraGroupId, orentraGroupName.-f, --forceDon't prompt for confirming removing the role assignment.
-h, --help [help]Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options,examples,remarks,permissions,response,full. Default isoptions.--query [query]JMESPath query string. See http://jmespath.org/ for more information and examples.
-o, --output [output]Output type.
json,text,csv,md,none. Defaultjson.--verboseRuns command with verbose logging.
--debugRuns command with debug logging.
Examples
Remove roleassignment from list by title based on group name.
m365 spo list roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --listTitle "someList" --groupName "saleGroup"
Remove roleassignment from list by title based on principal Id.
m365 spo list roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --listTitle "Events" --principalId 2
Remove roleassignment from list by url based on principal Id.
m365 spo list roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --listUrl '/sites/contoso-sales/lists/Events' --principalId 2
Remove roleassignment from Microsoft Entra group specified by display name.
m365 spo list roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --listUrl '/sites/contoso-sales/lists/Events' --entraGroupName "Sales Team"
Response
The command won't return a response on success.