Skip to content

spo group member remove

Removes the specified member from a SharePoint group

Usage

m365 spo group member remove [options]

Options

-u, --webUrl <webUrl>
URL of the site where the SharePoint group is available
--groupId [groupId]
Id of the SharePoint group from which the user has to be removed. Specify either groupName or groupId, but not both
--groupName [groupName]
Name of the SharePoint group from which user has to be removed. Specify either groupName or groupId, but not both
--userName <userName>
The UPN of the user that needs to be removed (user principal name, eg. megan.bowen@contoso.com)
-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 is full.
--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples
-o, --output [output]
Output type. json,text,csv. Default json
--verbose
Runs command with verbose logging
--debug
Runs command with debug logging

Examples

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

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

Remove a user from SharePoint group with Name Site A Visitors available on the web https://contoso.sharepoint.com/sites/SiteA

m365 spo group member remove --webUrl https://contoso.sharepoint.com/sites/SiteA --groupName "Site A Visitors" --userName "Alex.Wilber@contoso.com"