A
Anders K. Olsen
Hello Group
I'm working on a web application where I need to list all groups that the
current user is a member of. I'm using Integrated Windows Authentication on
the server.
Listing the groups is quite easy with ASP.Net 2.0, and I can do that using:
WindowsIdentity ident = (WindowsIdentity) User.Identity;
foreach (IdentityReference id in ident.groups)
{
NTAccount ac = (NTAccount) id.Translate(typeof(NTAccount));
String group = ac.Value;
}
My problem is that some of the groups belong to the BUILTIN domain, e.g.
BUILTIN\Users.
I assume that BUILTIN refers to the name of the local computer that the user
is using. Do you know of any way that I can look up this computer name?
I have tried Request.ServerVariables["REMOTE_HOST"] and "REMOTE_ADDR", but
they just give me the 127.0.0.1 - the IP address of localhost.
Regards
Anders Olsen
I'm working on a web application where I need to list all groups that the
current user is a member of. I'm using Integrated Windows Authentication on
the server.
Listing the groups is quite easy with ASP.Net 2.0, and I can do that using:
WindowsIdentity ident = (WindowsIdentity) User.Identity;
foreach (IdentityReference id in ident.groups)
{
NTAccount ac = (NTAccount) id.Translate(typeof(NTAccount));
String group = ac.Value;
}
My problem is that some of the groups belong to the BUILTIN domain, e.g.
BUILTIN\Users.
I assume that BUILTIN refers to the name of the local computer that the user
is using. Do you know of any way that I can look up this computer name?
I have tried Request.ServerVariables["REMOTE_HOST"] and "REMOTE_ADDR", but
they just give me the 127.0.0.1 - the IP address of localhost.
Regards
Anders Olsen