Click here to Skip to main content
15,885,953 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Re-Visit Solution:

Why not you ask user to enter the group name like "ABC\TI0022" & while receiving you can easily get the Group name. Otherwise it is not possible to get the group name because as RyanDev said, if you have 30 AD group you need to check the user details in every group and if user belongs to more than one group then how you handle that situation.

Newbie to Active Directory and using it as away to create a secure and seamless login process for internal web application. You want thing to be very easy for the user. The solution above stated that the user should provide the group name like "ABC\TI0022". My question is would it be better to have a interface which allow them to select their group name and allow the code to verify if they belong in the group select. Also, this would give the system flexible to allow individual to be in multiple groups. Thank for any feedback in advance.

Thank and Kind Regards
Posted
Updated 20-Mar-15 4:01am
v3

You can use the System.DirectoryServices[^] namespace to run LDAP queries. A user could belong to multiple groups. I'd suggest googling for sample LDAP queries if you are unfamiliar with them.
 
Share this answer
 
Comments
Member 11227881 23-Feb-15 10:59am    
I am able to find the multiple groups using the System.DirectoryServices. I simple want to know the one group he belong to when he login. Why is it that I can not know the exact group from where he login. I just need the one group he belong to at the time or after login. I am able to get userid by using the Request.ServerVariable. There should be somethings that let me know the unique group at the time of login.
ZurdoDev 23-Feb-15 11:13am    
What do you mean by unique group? If a user belongs to 30 AD groups, which one do you want?
why not you ask user to enter the group name like "ABC\TI0022" & while receiving you can easily get the Group name. Otherwise it is not possible to get the group name because as RyanDev said, if you have 30 AD group you need to check the user details in every group and if user belongs to more than one group then how you handle that situation.
 
Share this answer
 
Comments
Member 11227881 2-Mar-15 10:08am    
The suggestion of asking the user to enter the group name like "ABC\TI0022" sound good. But, do you think that maybe more than what a user would like to do. They already have to remember so many passwords. How can I make this seamless for the user?

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