I’ve been asked to create a service in WCF, where input is user EMAIL-ID. there are many domains available in my server. My WCF service is hosted in xxx domain.
I need to get all yyy groups (Domain groups) for the user whose email matches.
Questions:
1. Can we connect to the Active directory from C#
2. How to get the User groups from C#.
3. It is just for user validation, there is nothing to do with Active Directory. (simple search in AD groups)
Since I’m new to this, even I dont know wheather it is possoble from C#. Early reply on this is highly appreciable. Thanks in advance.
The
System.DirectoryServices.AccountManagementnamespace is exactly what you need.Here’s some code that should get you started.