I'm using ASP.net with C# and have a very little idea about Active Directory. I've been given a task to write a program in steps below:
The ASP.net application is given the username of a user.
The application should query all the groups of the user with the given username.
Then the application should display these groups in two separate lists one consisting of the distribution groups and in other list, the rest of the groups.
Now, the querying for all the groups is easy. But how can I check whether the group is in distribution group or not?
I have not been given more information.
Any attribute or something I can check?
You can retreive this information from an attribute called Groupe-Type(last line).
(0x00000001) : Specifies a group that is created by the system.
(0x00000002) : Specifies a group with global scope.
(0x00000004) : Specifies a group with domain local scope.
(0x00000008) : Specifies a group with universal scope.
(0x00000010) : Specifies an APP_BASIC group for Windows Server Authorization Manager.
(0x00000020) : Specifies an APP_QUERY group fir Windows Server Authorization Manager.
(0x80000000) :Specifies a security group. If this flag is not set, then the group is a distribution group.
You can find in this answer or at the botton of this other one different ways to retreive groups a user belongs to.
You can find here how to retreive user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With