spo file roleinheritance break¶
Breaks inheritance of a file. Keeping existing permissions is the default behavior.
Usage¶
m365 spo file roleinheritance break [options]
Options¶
-u, --webUrl <webUrl>
- URL of the site where the file is located
--fileUrl [fileUrl]
- The server-relative URL of the file. Specify either
fileUrl
orfileId
but not both i, --fileId [fileId]
- The UniqueId (GUID) of the file. Specify either
fileUrl
orfileId
but not both -c, --clearExistingPermissions
- Clear all existing permissions from the file
--confirm
- Don't prompt for confirmation
-h, --help [help]
- Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options
,examples
,remarks
,response
,full
. Default isfull
. --query [query]
- JMESPath query string. See http://jmespath.org/ for more information and examples
-o, --output [output]
- Output type.
json,text,csv,md
. Defaultjson
--verbose
- Runs command with verbose logging
--debug
- Runs command with debug logging
Examples¶
Break the inheritance of a file with a specific id (UniqueId).
m365 spo file roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --fileId "b2307a39-e878-458b-bc90-03bc578531d6"
Break the inheritance of a file with a specific id (UniqueId) and clear all existing permissions.
m365 spo file roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --fileId "b2307a39-e878-458b-bc90-03bc578531d6" --clearExistingPermissions
Break the inheritance of a file with a specific server-relative URL.
m365 spo file roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --fileUrl "/sites/project-x/documents/Test1.docx"
Break the inheritance of a file with a specific server-relative URL and clear all existing permissions.
m365 spo file roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --fileUrl "/sites/project-x/documents/Test1.docx" --clearExistingPermissions