4programming
Programmer
Hello professionals,
I am in need of assistance with Active Directory and ASP and IIS. I have the following piece of code:
I do get a Windows NT account name as expected. So I know the code works. I am using a virtual directory and using Integrate windows authentication as my security. Please help with this. Thank you.
I am in need of assistance with Active Directory and ASP and IIS. I have the following piece of code:
Code:
UserName= instr(Session("User"),"\")
userSession = Mid(Session("User"), UserName+ 1, len(Session("User"))- UserName)
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
'objCommand.Properties("Page Size") = 1
'objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.CommandText = _
"SELECT GivenName, mail, title FROM 'Hidden' WHERE sAMAccountName ='" & userSession & "'"
Set objRecordSet = objCommand.Execute
[code]
The code is being developed locally so when I run this on my localhost it works great. On my localhost I am using Windows XP Professional and IIS 5. When this gets deployed to the web server(II6) so that my entire company can use it, this code does not work. What I mean by when I say it does not work is I do not get an error but rather my form text elements, GivenName, Mail and Title, do not get populated on the form with the Active directory query. If I
[code]
response.write usersession
I do get a Windows NT account name as expected. So I know the code works. I am using a virtual directory and using Integrate windows authentication as my security. Please help with this. Thank you.