I am having problems getting the groups from a specific AD group. My connectionstring: LDAP://my.computer/OU=MyGroup,DC=my,DC=computer
I want to create a dropdown list of all the groups in the group MyGroup. I am using the ActiveDirectoryRoleProvider class and function GetAllRoles().
When i debug i can se that the connectionstring is working and GetAllRoles() creats a list of the 7 groups that i want. BUT when the result is returned to my page ALL (30+) groups in AD is listed! I cant see where the other groups are coming from? I tried clearing the cache etc. but getting the same result everytime.
Anyone got a clue?
I can see in my call stack that System.Web.Security.Roles.GetAllRoles() and EPiServer.Security.MultplexingRoleProvider.GetAllRoles() are both called before my EPiServer.Security.ActiveDirectoryRoleProvider.GetAllRoles() is called.
Are one of these to two calles getting all the groups and that the ActiveDirectoryRoleProvider just adds to this list?
What other roleproviders are declared for the multiplexingroleprovider?
The unwanted groups are probably brought in by someother provider (WindowsRoleProvider for example).
If you only want the group provided by your ADprovider, then you could simply issue the call on that provider specifically instead, something like this:
string adRoles = ActiveDirectoryRoleProvider adrp = Roles.Providers["MyActiveRoleProvider"].GetAllRoles();
That worked perfectly!!