entra m365group user add
Adds user to specified Microsoft 365 Group or Microsoft Teams team
Usage
m365 entra m365group user add [options]
Alias
m365 teams user add [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 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.-r, --role [role]The role to be assigned to the new user. Allowed values:
Owner,Member. DefaultMember.
-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.
Examples
Add a new member with the userNames parameter to the specified Microsoft 365 Group.
m365 entra m365group user add --groupId '00000000-0000-0000-0000-000000000000' --userNames 'anne.matthews@contoso.onmicrosoft.com'
Add multiple new owners with the userNames parameter to the specified Microsoft 365 Group.
m365 entra m365group user add --groupName 'Contoso' --userNames 'anne.matthews@contoso.onmicrosoft.com, john.doe@contoso.onmicrosoft.com' --role Owner
Add a new member with the userNames parameter to the specified Microsoft Teams team.
m365 entra m365group member add --teamId '00000000-0000-0000-0000-000000000000' --userNames 'anne.matthews@contoso.onmicrosoft.com' --role Member
Add multiple new members with the ids parameter to the specified Microsoft Teams team.
m365 entra m365group user add --teamName 'Engineering' --ids '74a3b772-3122-447b-b9da-10895e238219,dd3d21e4-a142-46b9-8482-bca8fe9596b3' --role Member
Response
The command won't return a response on success.