For some reason GetAuthorizationGroups()
seems to be taking around 20 seconds to return the groups. I am using this code:
UserPrincipal user;
// This takes 20 seconds
user.GetAuthorizationGroups().OfType<GroupPrincipal>().ToList();
Anyone got any ideas or is it simply a slow AD domain? (It doesn't take that long to view the groups in Outlook for instance)
Try doing something with the UserPrincipal
object before making this call to try to remove the initialization time. If that new operation also takes a long time, then check out my other answers to similar questions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With