ADSI and ASP

  • Thread starter Thread starter Steffen Haugk
  • Start date Start date
S

Steffen Haugk

NT4 SP6
PWS
ADSI installed

Server is W2K advanced

Is it possible to determine the currently logged-in user for a given
computer name from an .asp web page?

Thanks,
Steffen
 
This is the route I use on our intranet to alter content
based upon user.

Sub GetUserInfo
Dim openDS
Set AdSystemInfo = Server.CreateObject("ADSystemInfo")
If IsNull(AdSystemInfo) Then Exit Sub
On Error Resume Next
Set openDS = GetObject("LDAP:")
Set AdUser = OpenDS.OpenDSObject
("LDAP://"&adSystemInfo.UserName, "domain\xxxxx", "password
", 0) ' Replace with Domain and Password
If Not IsNull(AdUser) Then
AdUser.GetInfo
If Session("UserName")<>AdUser.cn Then Session
("UserName")=AdUser.cn
End if
end Sub
 
Thank you for the reply. I get stuck at this line:

Set AdSystemInfo = Server.CreateObject("ADSystemInfo")

Also, I don't understand what GetUserInfo is trying to do.

My asp page reads a text file that includes computer names, and on the
webpage I wish to show usernames alongside the computer names. Any
ideas?

Thanks again,
Steffen
 
Back
Top