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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LDAP Query via ASP is timing out

Status
Not open for further replies.

ChuckG

MIS
Feb 28, 2001
211
US
Hi,

I've got a Windows 2000 Server SP4 that I've written a ASP page that takes the logged in user's username and query's the Active Directory to retrieve the email address and full name of the user.

Works fine on this server.

I'm preparing to put this server up on a VMWare server, and have loaded Server 2000 SP4, IIS5 and everytime you try to run the ASP page that does the LDAP query of the AD, it takes quite a while and returns:

Active Server Pages error 'ASP 0113'

Script timed out

/mail_upc_req.asp

The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.

Any suggestions ?

Thanks


ChuckG
-=-=-=-
Midnight Club BBS
telnet midnight.synchro.net
 
Without any code samples, it's hard to offer a more specific answer. But a good guess is that you may need to rewrite your code that calls to AD if that is where the hangup is. One way to test it is to do a response.end in various parts to see where the hangup is. Once you have that, then it should be easy to determine the solution from that point.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Well, here's the code

nt_name1 = Request.ServerVariables("LOGON_USER")
nt_name1 = right(nt_name1,8)

On Error Resume Next

Const ADS_SCOPE_SUBTREE = 2
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") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE


objCommand.CommandText = _
"SELECT distinguishedName FROM 'LDAP://dc=company,dc=global,dc=pvt' WHERE objectCategory='user' " & _
"AND sAMAccountName='"& nt_name1 &"'"
Set objRecordSet = objCommand.Execute

objRecordSet.MoveFirst
Do Until objRecordSet.EOF
Site1 = objRecordSet.Fields("distinguishedName")
Wscript.Echo objRecordSet.Fields("distinguishedName").Value
objRecordSet.MoveNext
Loop


It's failing as soon as it tries to do the last Do Until
Loop.



ChuckG
-=-=-=-
Midnight Club BBS
telnet midnight.synchro.net
 
To be a bit more exact, it's failing when it does the
objRecordSet.MoveNext

If I end it anytime before that statement, it runs through. But let that run and it bombs out.

ChuckG
-=-=-=-
Midnight Club BBS
telnet midnight.synchro.net
 
>Wscript.Echo objRecordSet.Fields("distinguishedName").Value
wscript.echo doesn't make any sense for the server and it doesn't know how to response. Myabe this.
[tt]response.write objRecordSet.Fields("distinguishedName").Value & "<br />"[/tt]
 
Found the problem, was an issue in the IIS Directory Security. Was using Windows integrated instead of clear text. Once I switched that back around, it worked just like on the other server.

Thanks for the help guys.



ChuckG
-=-=-=-
Midnight Club BBS
telnet midnight.synchro.net
 
You mean with wscript.echo? you must be joking.
 
You may have found that problem a lot quicker had you turned off "On Error Resume Next"

;-)



Just my 2¢
-Cole's Law: Shredded cabbage

--Greg
 
Yea I was looking back through that and realized that after I had it back up and working lol.



ChuckG
-=-=-=-
Midnight Club BBS
telnet midnight-club.org
 
Yea, this one is still in the process of getting content and setup. But you'd be surprised, there's apparently quite a few of the old BBS's revamped with Telnet access/etc.

This one has telnet access (just like the old dialup terminals), as well as http access for reading emails/message boards/file transfers and a FTP server.




ChuckG
-=-=-=-
Midnight Club BBS
telnet midnight-club.org
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top