Thanks to Nic Watters I found an useful Office 365 PowerShell scripts to extract the members from an Office 365 security group with PowerShell. Here are the instructions:
List members of a security group
- Display the security group objectid
- Copy the 32 digit objectid code of the security group you want to check members.
- Modify the following script to add the copied security group objectid. The following script will export members of a security group members to csv.
Get-MsolGroupMember -groupObjectid ‘xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx’ | Select DisplayName,EmailAddress,GroupMemberType | Export-csv C:\tools\security-group-members.csv
Umakant GuptaMay 20, 2018 at 6:11 am
It is awesome.. It displays all the member of group without limitation.
Get-MsolGroupMember -GroupObjectId ‘xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx’ -All | Select DisplayName,EmailAddress,GroupMemberType | Export-csv C:\tools\security-group-members.csv
Jasper OosterveldJuly 3, 2018 at 8:21 am