Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get NT Usergroups withASP

Status
Not open for further replies.

krkX

Programmer
Nov 12, 2000
54
0
0
NL
Hello,

I retrieve the NT username trough ASP, i now want to know what NT usergroups this specific user is a member of..

Is this at all possible with asp..?? if yes any direction to a solution would be most appreciated..

Thanks :)
 
That doesn't really apply as i am using IIS 4 and want this for a web logon..

Is it possible to do an api call with ASP..??

krkX
 
Try using the netapi32 api calls.. Best way I've found is to create an ActiveX DLL via Visual Basic, and reference through a global.asa into session variables...

Here's the API Stuff that gets you into the NT user info..
Use either in VB or C..something similar

Use this as your launch pad B-)


Declare Function NetGetDCName Lib "netapi32" (lpServer As Any, lpDomain As Any, lpBuffer As Long) As Long
Declare Function NetUserGetInfo Lib "netapi32" (lpServer As Any, UserName As Byte, ByVal Level As Long, lpBuffer As Long) As Long
Declare Function NetUserGetGroups Lib "netapi32" (lpServer As Any, UserName As Byte, ByVal Level As Long, lpBuffer As Long, ByVal PrefMaxLen As Long, lpEntriesRead As Long, lpTotalEntries As Long) As Long
Declare Function NetUserGetLocalGroups Lib "netapi32" (lpServer As Any, UserName As Byte, ByVal Level As Long, ByVal Flags As Long, lpBuffer As Long, ByVal MaxLen As Long, lpEntriesRead As Long, lpTotalEntries As Long) As Long
Declare Function NetApiBufferFree Lib "netapi32" (ByVal pBuffer As Long) As Long
Declare Function NetRemoteTOD Lib "NETAPI32.DLL" (yServer As Any, pBuffer As Long) As Long
Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Declare Function GetUserNameW Lib "advapi32.dll" (lpBuffer As Byte, nSize As Long) As Long
Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Declare Function GetComputerNameW Lib "kernel32" (lpBuffer As Any, nSize As Long) As Long
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top