I ran into a similar problem and was able to diagnose it. The problem that I think depends on how the group is extracted - are the members of the group included; you can use .Expand () clause for this.
For example, the following works:
group = (Group)(await _activeDirectoryClient.Groups.Where(g => g.ObjectId == groupId).Expand(g => g.Members).ExecuteSingleAsync()); user = (User)(await _activeDirectoryClient.Users.Where(u => u.ObjectId == userId).ExecuteSingleAsync()); group.Members.Remove(user); await group.UpdateAsync();
Note, however, that the .Expand () operation is limited to 20 objects, so in most cases the solution from TomΓ‘Ε‘ is probably safer now.
source share