entra m365group user remove
Removes the specified user from specified Microsoft 365 Group or Microsoft Teams team
Usage
m365 entra m365group user remove [options]
Options
-i, --groupId [groupId]The ID of the Microsoft 365 group. Specify only one of the following:
groupId,groupName,teamId, orteamName.--groupName [groupName]The display name of the Microsoft 365 group. Specify only one of the following:
groupId,groupName,teamId, orteamName.--teamId [teamId]The ID of the Microsoft Teams team. Specify only one of the following:
groupId,groupName,teamId, orteamName.--teamName [teamName]The display name of the Microsoft Teams team. Specify only one of the following:
groupId,groupName,teamId, orteamName.--ids [ids]Microsoft Entra IDs of users. You can also pass a comma-separated list of IDs. Specify either
idsoruserNamesbut not both.--userNames [userNames]The user principal names of users. You can also pass a comma-separated list of UPNs. Specify either
idsoruserNamesbut not both.-f, --forceDon't prompt for confirming removing the user from the specified Microsoft 365 Group or Microsoft Teams team.
-h, --help [help]Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options,examples,remarks,permissions,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.--verboseRuns command with verbose logging.
--debugRuns command with debug logging.
Remarks
You can remove users from a Microsoft 365 Group or Microsoft Teams team if you are owner of that group or team.
Examples
Removes user from the specified Microsoft 365 Group.
m365 entra m365group user remove --groupId '5b8e4cb1-ea40-484b-a94e-02a4313fefb4' --userNames 'anne.matthews@contoso.onmicrosoft.com'
Removes user from the specified Microsoft 365 Team specified by id without confirmation.
m365 entra m365group user remove --teamId '5b8e4cb1-ea40-484b-a94e-02a4313fefb4' --userNames 'anne.matthews@contoso.onmicrosoft.com' --force
Removes users specified by a comma separated list of user principal names from the specified Microsoft Teams team specified by name
m365 entra m365group user remove --teamName 'Project Team' --userNames 'anne.matthews@contoso.onmicrosoft.com,john@contoso.com'
Removes users specified by a comma separated list of user ids from the specified Microsoft 365 group specified by name.
m365 entra m365group user remove --groupName 'Project Team' --ids '5b8e4cb1-ea40-484b-a94e-02a4313fefb4,be7a56d8-b045-4938-af35-917ab6e5309f'
Response
The command won't return a response on success.