Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
PrincipalContext ctx = new PrincipalContext(ContextType.ApplicationDirectory, "domain.com", "ou=*Garden City Users, o=microsoft,c=us", ContextOptions.SecureSocketLayer | ContextOptions.SimpleBind, "CN=ppatel, OU=*Garden City Users, O=Microsoft, C=US ", "password");
           UserPrincipal up = UserPrincipal.FindByIdentity(ctx, IdentityType.Name,"ppatel");

           if (up != null)
           {
               PrincipalSearchResult<Principal> Results = up.GetAuthorizationGroups();
               foreach (Principal Result in Results)
               {
                   Response.Write(Result.Name);
               }
           }


I am trying to get all the group to which user is associated. My code is above. when i am trying to run it i am getting error that LDAP SERVER IS UNAVAILABLE ....

Can anyone please help on this

Thanks
PPatel
Posted

1 solution

 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900