As you can see in the following code snippets, AzureAD command returns the correct output while Entra command doesn't output service principal members:
Get-AzureAdGroup -ObjectId 'b0c07cae-5f21-49db-b4a3-c42f53b98a8d' |
Get-AzureAdGroupMember |
Select-Object DisplayName,ObjectType
DisplayName ObjectType
----------- ----------
Microsoft Azure ServicePrincipal
Aleksandar Nikolic User
Alex Wilber User
testgroup1 Group
Diegos App3 ServicePrincipal
Get-EntraGroup -ObjectId 'b0c07cae-5f21-49db-b4a3-c42f53b98a8d' |
Get-EntraGroupMember |
Select-Object DisplayName,'@odata.type'
displayName @odata.type
----------- -----------
Aleksandar Nikolic #microsoft.graph.user
Alex Wilber #microsoft.graph.user
testgroup1 #microsoft.graph.group
Problem lies in v1.0 version of Microsoft Graph API and Get-MgGroupMember used under the covers.
It's a known issue that's not fixed for months (years?).
Strangely, Get-MgGroupMemberAsServicePrincipalworks as expected.
As you can see in the following code snippets, AzureAD command returns the correct output while Entra command doesn't output service principal members:
Problem lies in v1.0 version of Microsoft Graph API and
Get-MgGroupMember
used under the covers. It's a known issue that's not fixed for months (years?). Strangely,Get-MgGroupMemberAsServicePrincipal
works as expected.