Hello.
I need a list of grups (roles) of a logged user (without Active Directory)
I've been searching info about how to get groups that a user belongs to, and i've found this way to do it:
public static string[] groupList(System.Security.Principal.WindowsIdentity wId)
{
Type type = wId.GetType();
Object[] arr = new Object[] { wId.Token };
Object oRoles = type.InvokeMember("_GetRoles", BindingFlags.Static |
BindingFlags.InvokeMethod | BindingFlags.NonPublic, null, wId, arr);
return (string[])oRoles;
}
This code invokes to a static private member of the class WindowsIdentity (_GetRoles).
I do not like much this solution, because hacking .NET is not good .... ![]()
Do you know other way to get this information
Thanks.

How to get user groups without active directory...
bk pradeep
And framework1
I need use Framework 1
Russell Maidment
Starting with v2.0 you can use the Groups property of WindowsIdentity to get the NTAccount groups of the user.
Michael Taylor - 1/30/06
X5-Eric
I assume in your code you are relying on an internal member of the class. This is, as you know, unsafe. The only alternative for pre-2.0 is unmanaged code. Fortunately others have already done all the work.
http://dotnet247.com/247reference/msgs/51/256412.aspx
http://www.mcse.ms/archive113-2004-11-505880.html
Michael Taylor - 1/30/06