Share via

PowerShell - Getting Contacts From A Specific Mailbox Only

Anonymous
2021-03-14T17:15:34+00:00

When I connect to Exchange with my credentials (I'm an admin) and use Get-Contact, I get all the contacts defined under Exchange->Recipients->Contacts.

However, what I want to do is pull the actual contacts defined within a user's account.

If I connect to Exchange with the mailbox's credentials rather than mine, I do not have access to the Get-Contact command.

I'm not a PowerShell expert, so I'm not sure if this is done with impersonation, Get-Mailbox or some other method.

How do I accomplish what I am trying to do?

Thanks

Microsoft 365 and Office | Subscription, account, billing | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2021-03-14T20:57:47+00:00

    Hello MichaelL369,

    Based on my knowledge, the command Get-Contact is to view existing contact objects in your organization and the contact objects include contacts and mail contacts. Besides, you should run the commands using an admin account and the user have granted you permission. Regarding your requirement, I also did a lot of tests and researches at my side. Unfortunately, the resources are limit and I didn't find any relevant official document to get the contacts. As a workaround, you can view the user's contacts, please follow the steps in this article: Open another person's Exchange Contacts.

    To get more professional assistance, I strongly recommend you post your requirement in Microsoft Q&A Forum, which is a dedicated forum for customers who want to use Exchange Online PowerShell. In that forum, you will get more qualified pool of respondents, and other partners who read the forums regularly can share their knowledge with you.

    Thanks for your understanding.

    Best Regards,

    Seven

    Was this answer helpful?

    0 comments No comments