Skip to content

New command: Sends a chat message to a Microsoft Teams channel #4367

@nanddeepn

Description

@nanddeepn

Usage

teams message send [options]

Description

Sends a chat message to a Microsoft Teams channel

Options

Option Description
-i, --teamId <teamId> The ID of the team where the channel is located
-c, --channelId <channelId> The ID of the channel
-m, --message <message> The message to send

Examples

Send a message in a channel

m365 teams message send --teamId 5f5d7b71-1161-44d8-bcc1-3da710eb4171 --channelId 19:[email protected] --message "Hello World"

Default properties

No response

Additional Info

The existing command teams chat message send is limited to sends a chat message to a Microsoft Teams chat conversation only.

While implementing PnP Script Sample, I observed we are missing command to send message to MS Teams channel.

The following Graph endpoint can be used:
https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions