Skip to content

aad o365group user add

Adds user to specified Microsoft 365 Group or Microsoft Teams team

Usage

m365 aad o365group user add [options]

Alias

m365 teams user add

Options

-i, --groupId [groupId]
The ID of the Microsoft 365 Group to which to add the user
--teamId [teamId]
The ID of the Teams team to which to add the user
-n, --userName <userName>
User's UPN (user principal name, eg. johndoe@example.com)
-r, --role [role]
The role to be assigned to the new user: Owner,Member. Default Member
-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,md. Default json
--verbose
Runs command with verbose logging
--debug
Runs command with debug logging

Examples

Add a new member to the specified Microsoft 365 Group

m365 aad o365group user add --groupId '00000000-0000-0000-0000-000000000000' --userName 'anne.matthews@contoso.onmicrosoft.com'

Add a new owner to the specified Microsoft 365 Group

m365 aad o365group user add --groupId '00000000-0000-0000-0000-000000000000' --userName 'anne.matthews@contoso.onmicrosoft.com' --role Owner

Add a new member to the specified Microsoft Teams team

m365 teams user add --teamId '00000000-0000-0000-0000-000000000000' --userName 'anne.matthews@contoso.onmicrosoft.com'