Question

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)

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top