import Global from '/docs/cmd/_global.mdx';
Permanently removes a specific message from a mailbox
m365 outlook message remove [options]
`-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.
:::warning
This command will permanently delete the Outlook message. To move a message to the trash bin, use outlook message move instead.
:::
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 sharedmailbox@contoso.com
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 john.doe@contoso.com
The command won't return a response on success.