Last active
February 23, 2023 14:04
-
-
Save maisarissi/92b6e6afcc821de6581d883403e7f470 to your computer and use it in GitHub Desktop.
msgraph-dotnet-v5-rc-odata-cast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Fetching the members of a group who are of the type User | |
var usersInGroup = await graphServiceClient | |
.Groups["group-id"] | |
.Members | |
.MicrosoftGraphUser | |
.GetAsync(); | |
List<User> userList = usersInGroup.Value; | |
//Similarly, members of the group of type ServicePrincipal | |
var servicePrincipalsInGroup = await graphServiceClient | |
.Groups["group-id"] | |
.Members | |
.MicrosoftGraphServicePrincipal | |
.GetAsync(); | |
List<ServicePrincipal> servicePrincipalList = servicePrincipalsInGroup.Value; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment