teams chat member add
Adds a member to a Microsoft Teams chat conversation.
Usage
m365 teams chat member add [options]
Options
-i, --chatId <chatId>The ID of the chat conversation.
--userId [userId]The ID of the user. Specify either
userIdoruserNamebut not both.--userName [userName]User's UPN (user principal name, e.g. johndoe@example.com). Specify either
userIdoruserNamebut not both.--role [role]The role for the user to add. Valid values are:
owner,guest. Defaults toowner.--visibleHistoryStartDateTime [visibleHistoryStartDateTime]Include chat history until a certain point in time. Specify either
visibleHistoryStartDateTime,withAllHistoryor neither.--withAllHistoryInclude all chat history. Specify either
visibleHistoryStartDateTime,withAllHistoryor neither.
-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
When you specify a value for role, consider the following:
ownercan only be used for internal users.guestcan only be used for guest users.
Examples
Add a member by ID to a Teams chat without sharing any chat history.
m365 teams chat member add --chatId 19:8b081ef6-4792-4def-b2c9-c363a1bf41d5_5031bb31-22c0-4f6f-9f73-91d34ab2b32d@unq.gbl.spaces --userId bd94e214-7852-48b0-a326-5a34b2a02183
Add a member by UPN to a Teams chat and share chat history until a specific point in time.
m365 teams chat member add --chatId 19:8b081ef6-4792-4def-b2c9-c363a1bf41d5_5031bb31-22c0-4f6f-9f73-91d34ab2b32d@unq.gbl.spaces --userName john.doe@contoso.com --visibleHistoryStartDateTime 2023-05-03T12:00:00Z
Add a guest member by UPN to a Teams chat and share all chat history.
m365 teams chat member add --chatId 19:8b081ef6-4792-4def-b2c9-c363a1bf41d5_5031bb31-22c0-4f6f-9f73-91d34ab2b32d@unq.gbl.spaces --userName nelson.wilke@fabrikam.com --role guest --withAllHistory
Response
The command won't return a response on success.