cerebalbore
Technical User
Hi,
I'm trying to learn VB.NET, using Visual Studio 2005, and I need to build an application for users to log in to that works with the Active Directory (so that my database doesn't need to store passwords, and users can use their XP passwords). I've searched the forums and found some code here and there, which has been very useful, but none of the threads seem to answer my question.
The problem I have is that I don't want a users XP account to be locked out if they enter their password incorrectly once (or more), just to not let them use this application, and none of the code I've found is explicit to this fact. I don't want to know what the password stored/encrypted in the AD is.
So, here's the code I used (thanks must go to CSutton, I've only changed bits to make it like other code I have, and variable oPath is the domain pulled from an earlier query, which works ok):
Dim Success As Boolean = False
Dim Entry As New System.DirectoryServices.DirectoryEntry(oPath)
Entry.Username = Username
Entry.Password = Password
Dim Searcher As New System.DirectoryServices.DirectorySearcher(Entry)
Searcher.SearchScope = SearchScope.Subtree
Try
Dim Results As System.DirectoryServices.SearchResult
Results = Searcher.FindOne
Success = Not (Results Is Nothing)
Catch ex As Exception
Success = False
End Try
Return Success
My question is "If a user enters their password incorrectly does this mean that the user could eventually be locked out of their XP account?"
(I don't want to do any more testing as our IT dept has already had to unlock my account several times this morning because I wanted to know what would happen with an incorrect password!)
Anyone have the answer to this?
Thank you
Kat
I'm such a noob
I'm trying to learn VB.NET, using Visual Studio 2005, and I need to build an application for users to log in to that works with the Active Directory (so that my database doesn't need to store passwords, and users can use their XP passwords). I've searched the forums and found some code here and there, which has been very useful, but none of the threads seem to answer my question.
The problem I have is that I don't want a users XP account to be locked out if they enter their password incorrectly once (or more), just to not let them use this application, and none of the code I've found is explicit to this fact. I don't want to know what the password stored/encrypted in the AD is.
So, here's the code I used (thanks must go to CSutton, I've only changed bits to make it like other code I have, and variable oPath is the domain pulled from an earlier query, which works ok):
Dim Success As Boolean = False
Dim Entry As New System.DirectoryServices.DirectoryEntry(oPath)
Entry.Username = Username
Entry.Password = Password
Dim Searcher As New System.DirectoryServices.DirectorySearcher(Entry)
Searcher.SearchScope = SearchScope.Subtree
Try
Dim Results As System.DirectoryServices.SearchResult
Results = Searcher.FindOne
Success = Not (Results Is Nothing)
Catch ex As Exception
Success = False
End Try
Return Success
My question is "If a user enters their password incorrectly does this mean that the user could eventually be locked out of their XP account?"
(I don't want to do any more testing as our IT dept has already had to unlock my account several times this morning because I wanted to know what would happen with an incorrect password!)
Anyone have the answer to this?
Thank you
Kat
I'm such a noob