How can I access a user's personal contacts in Outlook via the Graph API or PowerShell?

Christopher VerHoef 20 Reputation points
2024-12-17T00:47:36.5166667+00:00

I'm trying to export the personal contacts in Outlook of the employees in our company. As far as I know, I have admin permissions, and I feel like an admin ought to be able to view a user's personal contacts, but I can't figure it out. The closest I've come is using Get-MailboxFolderStatistics in PowerShell to view metadata about their Contacts folder (I can see the ItemsInFolder number go up and down when a contact is added or removed), but I can't access the data in the folder. I can see my own contacts on Graph Explorer, but when I try to access another user, I get an error message saying, "The specified object was not found in the store., Default folder Contacts not found."

Is there any way accessing a user's personal contacts can be done? Preferably via PowerShell; I don't have much experience in Graph and wouldn't know how to implement it.

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,181 questions
Outlook | Windows | Classic Outlook for Windows | For business
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2024-12-17T07:18:10.5066667+00:00

    Hello Christopher VerHoef,

    Thank you for reaching out to Microsoft Support!

    According to the documentation, there are two ways to access other users' contacts using the Graph API, one with delegated permissions and the other with application permissions, but there are limitations to delegated permissions that require other users to share contacts with you or delegate mail to you, as shown below:

    User's image

    If you use delegated permissions (which is what Graph Explorer does) but are not delegated by another user, you will get what you call errors when accessing, so application permissions are recommended for your needs, and we have tested for application permissions and they work very well.

    You can refer to the document, first you need to register the application in Azure AD and grant the application permission Contacts.Read, as shown below:

    User's image

    You can then get the token in Postman and parse it in jwt.ms, ensuring that the token has Contacts.Read permission.

    User's image

    Finally, you can send a request to get contacts for other users in your organization. My test results are as follows:

    Screenshot 2024-12-17 071640

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.