Get-MgUserContact is a Microsoft Graph PowerShell cmdlet used to retrieve personal contacts stored in a Microsoft 365 user’s mailbox. These contacts are typically created in Outlook and represent external people or organizations, not tenant users.
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 especially useful for automation and reporting scenarios, such as:
Before running this cmdlet, ensure you have:
Connect-MgGraph -Scopes "Contacts.Read"
You must specify the target user using UserId, which can be a User Principal Name (UPN) or Object ID.
Basic syntax:
Get-MgUserContact -UserId <String>
Get-MgUserContact -UserId "john.doe@example.com"
This command retrieves all personal contacts stored in John Doe’s mailbox.
Get-MgUserContact -UserId "john.doe@example.com" | Select-Object DisplayName, EmailAddresses, BusinessPhones
This example limits the output to commonly used contact fields for cleaner reporting.
Get-MgUserContact -UserId "john.doe@example.com" | Select-Object DisplayName, EmailAddresses, BusinessPhones |Export-Csv -Path "JohnDoeContacts.csv" -NoTypeInformation
This exports the user’s contacts into a CSV file, making it easy to archive or analyze externally.
This is a common point of confusion, so it’s good to clarify clearly:
| Cmdlet | Purpose |
| Get-MgUserContact | Retrieves personal Outlook contacts stored in a user’s mailbox |
| Get-MgContact | Retrieves organizational contacts stored in the tenant directory |
Key takeaway:
Use Get-MgUserContact for mailbox-level, user-created contacts.
Use Get-MgContact for directory-level, tenant-wide contacts.
| Key Point | Details |
| Cmdlet Name | Get-MgUserContact |
| Purpose | Retrieves personal Outlook contacts from a user’s mailbox |
| Data Source | User mailbox (personal contacts, not tenant users) |
| Required Parameter | UserId (UPN or Object ID) |
| Permissions Needed | Contacts.Read or Contacts.Read.All |
| Automation Benefit | Enables scripted contact audits, exports, and mailbox analysis |
| Common Use Cases | Contact backup, reporting, migrations, mailbox cleanup |
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