Get-AzureADGroupMember -ObjectId "xxxxx" | select mail | Export-Csv
If you'd like to export all attributes of the users, run this:
Get-AzureADGroupMember -ObjectId "xxxxx" | fl | Export-Csv
There's no need for that, as the AAD module returns the full object, it's simply not shown in the default formatting. So for example, this will do the trick:
Get-AzureADGroupMember -ObjectId 84b18857-3c01-48be-b707-492019c57142 | select UserPrincipalName,ProxyAddresses | Export-Csv -nti blabla.csv
Is there a way to run this script so that I don't have to look up the objectID every time I run the script. I want to run this based on principal name (Email Address).