Skip to content

spo group user add

Add a user or multiple users to SharePoint Group

Usage

m365 spo group user add [options]

Options

-u, --webUrl <webUrl>
URL of the site where the SharePoint group is available
--groupId <groupId>
Id of the SharePoint Group to which user needs to be added
--userName <userName>
User's UPN (user principal name, eg. megan.bowen@contoso.com). If multiple users needs to be added, they have to be comma separated (ex. megan.bowen@contoso.com,alex.wilber@contoso.com)
-h, --help
output usage information
--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples
-o, --output [output]
Output type. json,text. Default text
--verbose
Runs command with verbose logging
--debug
Runs command with debug logging

Examples

Add a user to the SharePoint group with id 5 available on the web https://contoso.sharepoint.com/sites/SiteA

m365 spo group user add --webUrl https://contoso.sharepoint.com/sites/SiteA --groupId 5 --userName "Alex.Wilber@contoso.com"

Add multiple users to the SharePoint group with id 5 available on the web https://contoso.sharepoint.com/sites/SiteA

m365 spo group user add --webUrl https://contoso.sharepoint.com/sites/SiteA --groupId 5 --userName "Alex.Wilber@contoso.com, Adele.Vance@contoso.com"