Forum Discussion
SteinG645
Jan 25, 2023Copper Contributor
M365 - Export all contacts from my users
Dear awesome people of the community, I’ve been trying for multiple days together with someone else (that person is more technical) to make a script that can export all contacts of my user’s mail...
Feb 02, 2023
I don't have experience in this particular action yet, but can you specify the name of the contact folder in the script? Check for contacts folder, if not present use contactpersonen?
SteinG645
Feb 02, 2023Copper Contributor
My collegue (far more technical than me) wasn't able to find a way via the script to change the name for the searched store (from contacts to contactpersonen) 😞
- aterneuzenFeb 03, 2023Brass ContributorEven when you do a get-mailbox you can check for prefered language.
But that on the side.
So if i get it right you want to export from every user there contacts and combine them ?
You could use the graph api.
https://learn.microsoft.com/en-us/graph/api/user-list-contacts?view=graph-rest-1.0
With the first you will get the name: contacts of contactpersonen already in a variable so it doesn't matter then anymore.