H
henrycortezwu
Hi All,
I'm trying to get the "groups" of a user that belongs to a domain by
just passing the user's userID & domain. Is this possible?
What I tried, and is working is the ff code ( i can get both local &
domain groups), but in Windows Application.
When I tried converting it to ASP.NET, it only gets the local
groups.
Dim id As WindowsIdentity = WindowsIdentity.GetCurrent()
Dim idType As Type
idType = GetType(WindowsIdentity)
Dim result As Object = idType.InvokeMember("_GetRoles",
BindingFlags.Static Or BindingFlags.InvokeMethod Or
BindingFlags.NonPublic, Nothing, id, New Object() {id.Token}, Nothing)
Dim roles() As String = DirectCast(result, String())
Dim i As Integer
Do Until i = roles.GetUpperBound(0)
Me.tbxAPI.Text = Me.tbxAPI.Text & roles(i) & vbCrLf
i = i + 1
Loop
Anyone knows how to make the code above possible in ASP.NET?
Maybe i just need to configure my IIS?
Pls help.
Thanks,
Henry
P.S. I'm a newbie in ASP.NET
I'm trying to get the "groups" of a user that belongs to a domain by
just passing the user's userID & domain. Is this possible?
What I tried, and is working is the ff code ( i can get both local &
domain groups), but in Windows Application.
When I tried converting it to ASP.NET, it only gets the local
groups.
Dim id As WindowsIdentity = WindowsIdentity.GetCurrent()
Dim idType As Type
idType = GetType(WindowsIdentity)
Dim result As Object = idType.InvokeMember("_GetRoles",
BindingFlags.Static Or BindingFlags.InvokeMethod Or
BindingFlags.NonPublic, Nothing, id, New Object() {id.Token}, Nothing)
Dim roles() As String = DirectCast(result, String())
Dim i As Integer
Do Until i = roles.GetUpperBound(0)
Me.tbxAPI.Text = Me.tbxAPI.Text & roles(i) & vbCrLf
i = i + 1
Loop
Anyone knows how to make the code above possible in ASP.NET?
Maybe i just need to configure my IIS?
Pls help.
Thanks,
Henry
P.S. I'm a newbie in ASP.NET