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
var user = await graphServiceClient | |
.Users["{user-id}"] | |
.GetAsync(requestConfiguration => | |
{ | |
requestConfiguration.Headers.Add("ConsistencyLevel","eventual"); | |
requestConfiguration.QueryParameters.Select = new string[] { "id", "createdDateTime"}; | |
}); |
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 |
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
InteractiveBrowserCredential interactiveBrowserCredential = new ("ClientID"); | |
//create client for calling v1 endpoint and get my info | |
Microsoft.Graph.GraphServiceClient graphServiceClient = new (tokenCredential, scopes); | |
var userFromV1 = await graphServiceClient.Me.GetAsync(); | |
//create client for calling beta endpoint and get my info | |
Microsoft.Graph.Beta.GraphServiceClient betaGraphServiceClient = new(tokenCredential, scopes); | |
var userFromBeta = await betaGraphServiceClient.Me.GetAsync(); |
NewerOlder