Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UserPrincipal.GetAuthorizationGroups() is slow

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)

like image 345
Cheetah Avatar asked Jun 04 '14 15:06

Cheetah


1 Answers

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.

like image 172
Sean Hall Avatar answered Oct 02 '22 14:10

Sean Hall