Getting AD groups from another spesific AD group



 I am having problems getting the groups from a specific AD group. My connectionstring: LDAP://,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

Sep 10, 2008 17:52

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?

Sep 11, 2008 9:13

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


Sep 11, 2008 10:36

That worked perfectly!!

 Thanks Smile

Sep 11, 2008 16:20
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.