cli-microsoft365 icon indicating copy to clipboard operation
cli-microsoft365 copied to clipboard

New command: outlook message remove

Open milanholemans opened this issue 1 year ago • 2 comments

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.

milanholemans avatar Jan 17 '24 16:01 milanholemans

Can I take it?

MartinM85 avatar Jan 22 '24 08:01 MartinM85

All yours @MartinM85

milanholemans avatar Jan 22 '24 08:01 milanholemans