spo group add
Creates group in the specified site
Usage
m365 spo group add [options]
Options
-u, --webUrl <webUrl>
URL of the site where the group should be added.
-n, --name <name>
Name of the group to add.
--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. Defaultfalse
.--onlyAllowMembersViewMembership [onlyAllowMembersViewMembership]
Who can view the membership of the group? When
false
everyone can view the group membership, otherwise only group members can. Defaulttrue
.--allowRequestToJoinLeave [allowRequestToJoinLeave]
Specify whether to allow users to request membership in this group and allow users to request to leave the group. Default
false
.--autoAcceptRequestToJoinLeave [autoAcceptRequestToJoinLeave]
If auto-accept is enabled, users will automatically be added or removed when they make a request. Default
false
.--requestToJoinLeaveEmailSetting [requestToJoinLeaveEmailSetting]
All membership requests will be sent to the email address specified.
-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.
Examples
Create group with title and description
m365 spo group add --webUrl https://contoso.sharepoint.com/sites/project-x --name "Project leaders" --description "This group contains all project leaders"
Create group with membership requests
m365 spo group add --webUrl https://contoso.sharepoint.com/sites/project-x --name "Project leaders" --allowRequestToJoinLeave true --requestToJoinLeaveEmailSetting john.doe@contoso.com
Response
- JSON
- Text
- CSV
- Markdown
{
"Id": 37,
"IsHiddenInUI": false,
"LoginName": "Project leaders",
"Title": "Project leaders",
"PrincipalType": 8,
"AllowMembersEditMembership": false,
"AllowRequestToJoinLeave": false,
"AutoAcceptRequestToJoinLeave": false,
"Description": "This group contains all project leaders",
"OnlyAllowMembersViewMembership": true,
"OwnerTitle": "Jon Doe",
"RequestToJoinLeaveEmailSetting": null
}
AllowMembersEditMembership : false
AllowRequestToJoinLeave : false
AutoAcceptRequestToJoinLeave : false
Description : This group contains all project leaders
Id : 38
IsHiddenInUI : false
LoginName : Project leaders
OnlyAllowMembersViewMembership: true
OwnerTitle : Jon Doe
PrincipalType : 8
RequestToJoinLeaveEmailSetting: null
Title : Project leaders
Id,IsHiddenInUI,LoginName,Title,PrincipalType,AllowMembersEditMembership,AllowRequestToJoinLeave,AutoAcceptRequestToJoinLeave,Description,OnlyAllowMembersViewMembership,OwnerTitle
39,,Project leaders,Project leaders,8,,,,This group contains all project leaders,1,Jon Doe
# spo group add --webUrl "https://contoso.sharepoint.com/sites/project-x" --name "Project leaders" --description "This group contains all project leaders"
Date: 10/3/2023
## Project leaders (40)
Property | Value
---------|-------
Id | 40
IsHiddenInUI | false
LoginName | Project leaders
Title | Project leaders
PrincipalType | 8
AllowMembersEditMembership | false
AllowRequestToJoinLeave | false
AutoAcceptRequestToJoinLeave | false
Description | This group contains all project leaders
OnlyAllowMembersViewMembership | true
OwnerTitle | Jon Doe