Copy-MgUserMessage is a Microsoft Graph PowerShell cmdlet used to copy an email message from one Outlook mail folder to another within a user’s mailbox without removing the original message.
The source message remains intact, making this cmdlet ideal for duplication and retention scenarios.
Try the M365Corner Microsoft 365 Reporting Tool — your DIY pack with 20+ out-of-the-box M365 reports for Users, Groups, and Teams.
This cmdlet is commonly used when:
Unlike Move-MgUserMessage, this cmdlet does not alter the original folder structure.
Before running this cmdlet, ensure:
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "Mail.ReadWrite"
You must specify:
Basic syntax:
Copy-MgUserMessage -UserId <String> -MessageId <String> -DestinationId <String>
This example copies a single email message with the specified MessageId from the user's mailbox to the destination folder identified by DestinationId.
Copy-MgUserMessage -UserId "user@domain.com" -MessageId "AAMkAG..." -DestinationId "AQMkAG..."
This example copies multiple messages by iterating through an array of MessageId values and copying each one to the specified destination folder.
$messageIds = @("AAMkAG...", "AAMkBG...")
foreach ($id in $messageIds) {
Copy-MgUserMessage -UserId "user@domain.com" -MessageId $id -DestinationId "AQMkAG..."
}
This example retrieves messages with a specific subject using the Get-MgUserMessage cmdlet and then copies those messages to the desired folder.
$messages = Get-MgUserMessage -UserId "user@domain.com" -Filter "subject eq 'Important'"
foreach ($message in $messages) {
Copy-MgUserMessage -UserId "user@domain.com" -MessageId $message.Id -DestinationId "AQMkAG..."
}
This example copies all messages from a user's mailbox to another folder.
$allMessages = Get-MgUserMessage -UserId "user@domain.com" -All
foreach ($message in $allMessages) {
Copy-MgUserMessage -UserId "user@domain.com" -MessageId $message.Id -DestinationId "AQMkAG..."
}
| Feature | Copy-MgUserMessage | Move-MgUserMessage |
| Action | Copies the message | Moves the message |
| Original Message | Retained in source folder | Removed from source folder |
| Use Case | Compliance, duplication, backup | Cleanup, archiving, reorganization |
| Folder Impact | Message exists in multiple folders | Message exists in one folder |
| Data Safety | Non-destructive | Destructive to source location |
Tip:
Use Copy-MgUserMessage when retention matters, and Move-MgUserMessage when mailbox cleanup is the goal.
| Key Point | Details |
| Cmdlet Name | Copy-MgUserMessage |
| Purpose | Copies email messages between Outlook mail folders |
| Required Scope | Mail.ReadWrite |
| Target | User mailbox messages |
| Primary Parameters | UserId, MessageId, DestinationId |
| Automation Benefit | Enables message duplication without altering originals |
| Common Use Case | Compliance, backups, parallel mailbox organization |
Did You Know? Managing Microsoft 365 applications is even easier with automation. Try our Graph PowerShell scripts to automate tasks like generating reports, cleaning up inactive Teams, or assigning licenses efficiently.
Ready to get the most out of Microsoft 365 tools? Explore our free Microsoft 365 administration tools to simplify your administrative tasks and boost productivity.
© Created and Maintained by LEARNIT WELL SOLUTIONS. All Rights Reserved.