Usage
m365 spo site accessrequest setting set [options]
Description
Update access requests for a specific site
Options
| Option |
Description |
-u, --siteUrl <siteUrl> |
URL of the site collection. |
--disabled |
Disable site requests for the entire site. Specify either disabled, ownerGroup, or email. |
--ownerGroup |
Send access requests to the owner group. Specify either disabled, ownerGroup, or email. |
--email [email] |
Send access requests to a specific email. Specify either disabled, ownerGroup, or email. |
--message [message] |
Add a custom message to the access request page. |
Examples
Disable access requests for a specific site.
m365 spo site accessrequest setting set --siteUrl https://contoso.sharepoint.com/sites/Management --disabled
Send all access requests to the owner group of a specific site.
m365 spo site accessrequest setting set --siteUrl https://contoso.sharepoint.com/sites/Management --ownerGroup
Send all access requests to a specific email address and set a custom message.
m365 spo site accessrequest setting set --siteUrl https://contoso.sharepoint.com/sites/Management --email [email protected] --message "Motivate why you need access."
Default properties
N/A
Additional Info
The original idea was created here: #6266
I named this command spo site accessrequest setting set to make it future-proof. In this case, we can still create commands to list all access requests from people on a site, and other commands do approve/decline them.
Let's also make sure we can pass an empty string for message option to clear it.
API
To manage this, there are 3 API requests needed:
Request 1:
PATCH https://contoso.sharepoint.com/sites/Playground/_api/Web
{
"RequestAccessEmail": "[email protected]"
}
Request 2:
POST https://contoso.sharepoint.com/sites/Playground/_api/Web/SetUseAccessRequestDefaultAndUpdate
{
"useAccessRequestDefault": false
}
Request 3:
POST https://contoso.sharepoint.com/sites/Playground/_api/Web/SetAccessRequestSiteDescriptionAndUpdate
{
"description": "Hey you want access? That's $77."
}
When updating access requests, consider the following:
Request 3 should only be used when --message is specified (this isn't possible when using --disabled).
Usage
m365 spo site accessrequest setting set [options]
Description
Update access requests for a specific site
Options
-u, --siteUrl <siteUrl>--disableddisabled,ownerGroup, oremail.--ownerGroupdisabled,ownerGroup, oremail.--email [email]disabled,ownerGroup, oremail.--message [message]Examples
Disable access requests for a specific site.
m365 spo site accessrequest setting set --siteUrl https://contoso.sharepoint.com/sites/Management --disabledSend all access requests to the owner group of a specific site.
m365 spo site accessrequest setting set --siteUrl https://contoso.sharepoint.com/sites/Management --ownerGroupSend all access requests to a specific email address and set a custom message.
Default properties
N/A
Additional Info
The original idea was created here: #6266
I named this command
spo site accessrequest setting setto make it future-proof. In this case, we can still create commands to list all access requests from people on a site, and other commands do approve/decline them.Let's also make sure we can pass an empty string for
messageoption to clear it.API
To manage this, there are 3 API requests needed:
Request 1:
Request 2:
Request 3:
When updating access requests, consider the following:
--disabled""(empty)false--ownerGroup""(empty)true--email [email protected][email protected]falseRequest 3 should only be used when
--messageis specified (this isn't possible when using--disabled).