How to Export All Email Addresses Using Microsoft Graph PowerShell SDK?

0
4
Asked By CuriousCoder92 On

I'm trying to export all email addresses from my tenant, including mailboxes, shared mailboxes, M365 groups, distribution lists, dynamic distribution lists, and mail-enabled security groups, to a CSV file using the Microsoft Graph PowerShell SDK. I used to rely on older modules like MSOnline and AzureAD, but now I need to adapt my script for Graph. I've noticed that my current implementation is missing several addresses in the CSV compared to my previous exports. Can anyone share their experiences or solutions on how to export all these email addresses correctly? Also, here's a portion of my old and new scripts for context!

1 Answer

Answered By TechSavvy101 On

Have you looked into using `Get-Recipient`? It simplifies fetching all mail-enabled objects in one go, which might make your life easier when exporting.

PowershellNinja -

Yes, but for automation, it’s wiser to stick with the Graph SDK. It’s just more future-proof.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.