Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > SetPassword takes a long time to run

Thread Tools

SetPassword takes a long time to run

Posts: n/a
Using ASP.NET 2.0 I have a webpage to set a users password although it is
taking up to 38 seconds to run. Tracing the code shows that the line of code
used to invoke the new password appears to be the hold up. Any thoughts? Code
is below:

Sub Button_SubmitReset(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSubmit1.Click
Dim AdEntry As New DirectoryEntry("LDAP://" &
AppSettings("DcServerName").ToString() & "/" &
AppSettings("AdPath").ToString(), AppSettings("AdAdminUserName").ToString(),
AppSettings("AdAdminUserPassword").ToString(), AuthenticationTypes.Secure)
Dim AdFilter As String =
"(&(objectCategory=person)(objectClass=user)(UserP rincipalName=" &
Session.Contents("UserPrincipalName") & "*))"

Using AdEntry
Dim AdSearcher As New DirectorySearcher(AdEntry, AdFilter)
Using AdSearcher
AdSearcher.PageSize = 1
AdSearcher.SearchScope = SearchScope.Subtree

Dim Result As SearchResult = AdSearcher.FindOne()

If (Result Is Nothing) Then
lblMessage1.Text = "Unable to retrieve your network account information."
Dim AdUserEntry As DirectoryEntry = Result.GetDirectoryEntry()
' Get auto generated password
Dim strPG As String = ""
strPG = PasswordGenerator()
' Set the password
Trace.Write("Invoke", "--- [ BEGIN ] ---")
AdUserEntry.Invoke("SetPassword", New Object() {strPG})
Trace.Write("Invoke", "--- [ END ] ---")
' Exit
lblPassword.Text = strPG
strPG = ""
End If
End Using
End Using
End Sub

I appreciate any suggestions.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Having compilation error: no match for call to (const __gnu_cxx::hash<long long int>) (const long long int&) veryhotsausage C++ 1 07-04-2008 05:41 PM
Query Takes a Long Time to Run Mick Walker ASP .Net 5 07-05-2007 03:37 PM
LDAP SetPassword Exception help 1388-2/HB ASP .Net 0 08-29-2006 07:00 PM
Invoke(SetPassword) in Active Directory, Works, Then Access is Den ptstesting ASP .Net Security 5 04-03-2006 02:43 PM
Active Directory - setPassword method error knea ASP .Net 2 06-19-2004 04:16 AM