Posted on: 9/24/2015 11:40:44 AM | Views : 2416

hi all,
i'm trying to get list of groups associated with the client account in AD so, i have written below code
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "MyDomainName");
UserPrincipal user = UserPrincipal.FindByIdentity(ctx, userName); if (user != null) { try {
PrincipalSearchResult<Principal> groups = user.GetAuthorizationGroups();
}
catch(PrincipalOperationException ex) { }
for few clinets i could get exact group names but, for some of them im getting exception at above BOLD place.
the exception im getting is 
{"While trying to retrieve the authorization groups, an error (5) occurred."}
i sets Impersonate=true/false but, no luck.
i sets user.GetGroups(); instead of user.GetAuthorizationGroups(); but, GetGroups() output not seems good
experts can you please help me.
...

Go to the complete details ...