Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,802 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to move a message from one folder to another in the same mailbox. I can't find the command in the PowerShell SDK for this. :-/ Help?
Never mind. I found it (and the answer is actually on the page I'd linked. Oops.). I'd actually tried Move-MgUserMessage but it wasn't working because the command isn't in the Graph Mail module where I expected it to be, but in Users.Actions.
Import-Module Microsoft.Graph.Users.Actions
$params = @{
DestinationId = "deleteditems"
}
# A UPN can also be used as -UserId.
Move-MgUserMessage -UserId $userId -MessageId $messageId -BodyParameter $params