Home

How the export Azure AD security group members email addresses into CSV?

%3CLINGO-SUB%20id%3D%22lingo-sub-217946%22%20slang%3D%22en-US%22%3EHow%20the%20export%20Azure%20AD%20security%20group%20members%20email%20addresses%20into%20CSV%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-217946%22%20slang%3D%22en-US%22%3EHi%20Forum%2C%3CBR%20%2F%3E%3CBR%20%2F%3EHow%20the%20export%20Azure%20AD%20security%20group%20members%20email%20addresses%20into%20CSV%3F%3CBR%20%2F%3E%3CBR%20%2F%3EI%20tried%20this%20PowerShell%20command%3A%3CBR%20%2F%3E%3CBR%20%2F%3EGet-AzureADGroupMember%20-ObjectId%20%22xxxx....%22%20%7C%20Export-csv%20-path%20C%3A%5CTemp%5COutput.csv%3CBR%20%2F%3E%3CBR%20%2F%3EBut%2C%20It%20only%20generated%20IDs.%20How%20can%20I%20get%20the%20members%20email%20addresses%3F%3CBR%20%2F%3E%3CBR%20%2F%3Eplease%2C%20Let%20me%20know!%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-217946%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20AD%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESecurity%20group%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-308214%22%20slang%3D%22en-US%22%3ERe%3A%20How%20the%20export%20Azure%20AD%20security%20group%20members%20email%20addresses%20into%20CSV%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-308214%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20there%20a%20way%20to%20run%20this%20script%20so%20that%20I%20don't%20have%20to%20look%20up%20the%20objectID%20every%20time%20I%20run%20the%20script.%20I%20want%20to%20run%20this%20based%20on%20principal%20name%20(Email%20Address).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-218042%22%20slang%3D%22en-US%22%3ERe%3A%20How%20the%20export%20Azure%20AD%20security%20group%20members%20email%20addresses%20into%20CSV%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-218042%22%20slang%3D%22en-US%22%3Eactually%20Max's%20response%20would%20work%20too%2C%20I%20was%20still%20asleep%20this%20morning%2C%20I%20would%20take%20back%20my%20response%20lol.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-218041%22%20slang%3D%22en-US%22%3ERe%3A%20How%20the%20export%20Azure%20AD%20security%20group%20members%20email%20addresses%20into%20CSV%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-218041%22%20slang%3D%22en-US%22%3E%3CP%3EThere's%20no%20need%20for%20that%2C%20as%20the%20AAD%20module%20returns%20the%20full%20object%2C%20it's%20simply%20not%20shown%20in%20the%20default%20formatting.%20So%20for%20example%2C%20this%20will%20do%20the%20trick%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EGet-AzureADGroupMember%20-ObjectId%2084b18857-3c01-48be-b707-492019c57142%20%7C%20select%20UserPrincipalName%2CProxyAddresses%20%7C%20Export-Csv%20-nti%20blabla.csv%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-217983%22%20slang%3D%22en-US%22%3ERe%3A%20How%20the%20export%20Azure%20AD%20security%20group%20members%20email%20addresses%20into%20CSV%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-217983%22%20slang%3D%22en-US%22%3Eyou'll%20want%20to%20pipe%20in%20between%20there%20the%20get-azureaduser%20in%20between%20there%20to%20get%20the%20user%20details.%20so%20something%20like%20get-azureadgroupmember%20-objectid%20%22xxx%22%20%7C%20get-azureaduser%20%7C%20export%20etc.%20etc.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-217978%22%20slang%3D%22en-US%22%3ERe%3A%20How%20the%20export%20Azure%20AD%20security%20group%20members%20email%20addresses%20into%20CSV%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-217978%22%20slang%3D%22en-US%22%3E%3CP%3EGet-AzureADGroupMember%20-ObjectId%20%22xxxxx%22%20%7C%20select%20mail%20%7C%20Export-Csv%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EIf%20you'd%20like%20to%20export%20all%20attributes%20of%20the%20users%2C%20run%20this%3A%3C%2FP%3E%3CP%3EGet-AzureADGroupMember%20-ObjectId%20%22xxxxx%22%20%7C%20fl%20%7C%20Export-Csv%3C%2FP%3E%3C%2FLINGO-BODY%3E
Samer Forever
Occasional Contributor
Hi Forum,

How the export Azure AD security group members email addresses into CSV?

I tried this PowerShell command:

Get-AzureADGroupMember -ObjectId "xxxx...." | Export-csv -path C:\Temp\Output.csv

But, It only generated IDs. How can I get the members email addresses?

please, Let me know!
5 Replies

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

you'll want to pipe in between there the get-azureaduser in between there to get the user details. so something like get-azureadgroupmember -objectid "xxx" | get-azureaduser | export etc. etc.

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

actually Max's response would work too, I was still asleep this morning, I would take back my response lol.

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).

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
35 Replies
Extentions Synchronization
ChirmyRam in Discussions on
3 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies