Skip to content

New command: outlook message remove #5784

@milanholemans

Description

@milanholemans

Usage

m365 outlook message remove [options]

Description

Removes a specifc message from a mailbox

Options

Option Description
-i, --id <id> ID of the message.
--userId [userId] ID of the user that owns the mailbox. Specify either userId or userName, but not both. This option is required when using application permissions.
--userName [userName] User principal name of the user that owns the mailbox. Specify either userId or userName, but not both. This option is required when using application permissions.
-f, --force Don't prompt for confirmation.

Examples

Remove a specific message for the currently signed-in user

m365 outlook message remove --id AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAALvuv07AAA=

Remove a specific message in a shared mailbox

m365 outlook message remove --id AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAALvuv07AAA= --userName [email protected]

Remove a specific message from a specific mailbox specified by user ID using application permissions

m365 outlook message remove --id AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAALvuv07AAA= --userId 6799fd1a-723b-4eb7-8e52-41ae530274ca

Remove a specific message from a specific mailbox specified by user UPN using application permissions

m365 outlook message remove --id AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAALvuv07AAA= --userName [email protected]

Default properties

No response

Additional Info

API: https://learn.microsoft.com/en-us/graph/api/message-delete?view=graph-rest-1.0&tabs=http

Remarks

This command will permanently delete the Outlook message. To move a message to the trash bin, use outlook message move instead.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions