Getting AD groups from another spesific AD group

Vote:
 

Hi,

 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?

 -Kjetil Simensen

#23608
Sep 10, 2008 17:52
Vote:
 

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?

#23619
Sep 11, 2008 9:13
jo
Vote:
 

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();

 /johan

#23626
Sep 11, 2008 10:36
Vote:
 

That worked perfectly!!

 Thanks Smile

#23644
Sep 11, 2008 16:20