Remove-MgUserContact is a Microsoft Graph PowerShell cmdlet used to delete personal Outlook contacts from a specific user’s mailbox. It removes contacts that exist in the user’s Contacts folder, not directory users or Entra ID objects.
Try the M365Corner Microsoft 365 Reporting Tool — your DIY pack with 20+ out-of-the-box M365 reports for Users, Groups, and Teams.
Administrators and automation engineers use this cmdlet to:
Unlike tenant-level contact cmdlets, this operates only within a user’s mailbox.
Before using this cmdlet, ensure:
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "Contacts.ReadWrite"
The cmdlet requires the UserId (UPN or User ID) and the ContactId of the contact to delete.
Basic syntax:
Remove-MgUserContact -UserId <String>-ContactId <String>
You can obtain the ContactId using Get-MgUserContact before removal.
Remove-MgUserContact -UserId "john.doe@contoso.com" -ContactId "AAMkADkzZjk3ODk3LTgxMjQtNDI1NC1hYzBiLWZhM2Y4MTY1NzNlYwBGAAAAAABBbbQxofVsQqcQEAAAAAAA="
This command deletes a single Outlook contact from John Doe’s mailbox using the contact’s unique ID.
$contactsToRemove = @("ContactId1", "ContactId2", "ContactId3")
$userId = "john.doe@contoso.com"
foreach ($contactId in $contactsToRemove) {
Remove-MgUserContact -UserId $userId -ContactId $contactId
}
This script loops through multiple Contact IDs and removes each contact from the specified user’s mailbox.
| Aspect | Remove-MgUserContact | Remove-MgContact |
| Scope | User mailbox contacts | Directory (organizational) contacts |
| Contact Type | Personal Outlook contacts | Tenant-wide external contacts |
| Requires UserId | ✅ Yes | ❌ No |
| Typical Usage | Mailbox cleanup, migrations | Managing organizational contacts |
| Affects Entra ID | ❌ No | ✅ Yes |
In short:
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.
© Your Site Name. All Rights Reserved. Design by HTML Codex