spo site sharingpermission set
Controls how a site and its components can be shared
Usage
m365 spo site sharingpermission set [options]
Options
-u, --url <url>
URL of the site.
--capability <capability>
Define how the site is shared. Possible values:
full
,limited
,ownersOnly
.
-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 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
.--verbose
Runs command with verbose logging.
--debug
Runs command with debug logging.
Remarks
When specifying capability
, consider the following:
full
: Site owners and members can share files, folders, and the site. People with Edit permissions can share files and folders.limited
: Site owners and members, and people with Edit permissions can share files and folders, but only site owners can share the site.ownersOnly
: Only site owners can share files, folders, and the site.
Examples
Update the sharing permissions for a site so only owners can share files and the site
m365 spo site sharingpermission set --siteUrl https://siteaddress.com/sites/sitename --capability ownersOnly
Update the sharing permissions for a site where so both owners and members can share files and the site
m365 spo site sharingpermission set --siteUrl https://siteaddress.com/sites/sitename --capability full
Update the sharing permissions for a site where so owners can share the site, but members can only share files
m365 spo site sharingpermission set --siteUrl https://siteaddress.com/sites/sitename --capability limited
Response
The command won't return a response on success.
More information
- Sharing a SharePoint site: https://support.microsoft.com/office/share-a-site-958771a8-d041-4eb8-b51c-afea2eae3658