Usage
m365 spo group set
Description
Updates a group in the specified site
Options
| Option |
Description |
-u, --webUrl <webUrl> |
URL of the site where the group is located. |
-i, --id [id] |
Id of the group to update. Specify either id or name but not both. |
-n, --name [name] |
Name of the group. Specify either id or name but not both. |
--newName [newName] |
New name for the group. |
--description [description] |
The description for the group. |
--allowMembersEditMembership [allowMembersEditMembership] |
Who can edit the membership of the group? When true members can edit membership, otherwise only owners can do this. |
--onlyAllowMembersViewMembership [onlyAllowMembersViewMembership] |
Who can view the membership of the group? When true only group members can view the membership, otherwise everyone can. |
--allowRequestToJoinLeave [allowRequestToJoinLeave] |
Specify whether to allow users to request membership in this group and allow users to request to leave the group. |
--autoAcceptRequestToJoinLeave [autoAcceptRequestToJoinLeave] |
If auto-accept is enabled, users will automatically be added or removed when they make a request. |
--requestToJoinLeaveEmailSetting [requestToJoinLeaveEmailSetting] |
All membership requests will be sent to the e-mail address specified. |
--ownerEmail [ownerEmail] |
Set user with this email as owner of the group. Specify either ownerEmail or ownerUserName but not both. |
--ownerUserName [ownerUserName] |
Set user with this login name as owner of the group. Specify either ownerEmail or ownerUserName but not both. |
Examples
Update group title and description
m365 spo group set --webUrl https://contoso.sharepoint.com/sites/project-x --id 18 --newTitle "Project contributors" --description "This group contains all project contributors"
Update group with membership requests
m365 spo group set --webUrl https://contoso.sharepoint.com/sites/project-x --title "Project leaders" --allowRequestToJoinLeave true --requestToJoinLeaveEmailSetting [email protected]
Sets a specified user as group owner by group ID
m365 spo group set --webUrl https://contoso.sharepoint.com/sites/project-x --id 18 --ownerEmail [email protected]
Additional Info
Update group:
PATCH https://contoso.sharepoint.com/sites/project-x/_api/web/sitegroups(<id>)
Accept: application/json
Content-Type: application/json
{
"Title": "New Site Group",
"Description": "New Site Group description",
"AllowMembersEditMembership": false,
"OnlyAllowMembersViewMembership": false,
"AllowRequestToJoinLeave": false,
"AutoAcceptRequestToJoinLeave": false,
"RequestToJoinLeaveEmailSetting": "[email protected]"
}
Set owner:
POST https://contoso.sharepoint.com/sites/project-x/_api/web/sitegroups(<group id>)/SetUserAsOwner(<user id>)
Accept: application/json
Content-Type: application/json
Usage
m365 spo group set
Description
Updates a group in the specified site
Options
-u, --webUrl <webUrl>-i, --id [id]idornamebut not both.-n, --name [name]idornamebut not both.--newName [newName]--description [description]--allowMembersEditMembership [allowMembersEditMembership]truemembers can edit membership, otherwise only owners can do this.--onlyAllowMembersViewMembership [onlyAllowMembersViewMembership]trueonly group members can view the membership, otherwise everyone can.--allowRequestToJoinLeave [allowRequestToJoinLeave]--autoAcceptRequestToJoinLeave [autoAcceptRequestToJoinLeave]--requestToJoinLeaveEmailSetting [requestToJoinLeaveEmailSetting]--ownerEmail [ownerEmail]ownerEmailorownerUserNamebut not both.--ownerUserName [ownerUserName]ownerEmailorownerUserNamebut not both.Examples
Update group title and description
Update group with membership requests
Sets a specified user as group owner by group ID
Additional Info
Update group:
Set owner: