S
sameem
Hi All,
Im using windows athentication, Visual Studio 2005 and Windows XP, . I have
written code like below. This code is working fine when Im giving right user
name and password. If password is wrong in first attempt that got lock for my
Active Directory user. My requirement is, three attempt if password is wrong
like OS windows security policy to allow the user upto three attempt.
This is my code
------------------
Dim a As New DirectoryEntry("GC://domainname", Session("UName"),
Session("PWord"), AuthenticationTypes.Secure)
Dim searcher As New DirectorySearcher.FindOne()
Dim MyResultPropColl As ResultPropertyCollection(a,
"(&(objectCategory=user)(objectClass=person)(sAMAccountName=" +
Session("UName") + ")(!userAccountControl:1.2.850.113556.1.4.803:=2))") ',
"(&(anr=a-driches)(objectCategory=person))")
Dim sr As SearchResult = searcher. = sr.Properties
Dim myKey As String
For Each myKey In MyResultPropColl.PropertyNames
For Each mycollection As Object In MyResultPropColl(myKey)
If myKey = "memberof" Then
Cn.Add(mycollection.ToString)
End If
Next
Next
what shall I do for three attempt?
Regards,
Im using windows athentication, Visual Studio 2005 and Windows XP, . I have
written code like below. This code is working fine when Im giving right user
name and password. If password is wrong in first attempt that got lock for my
Active Directory user. My requirement is, three attempt if password is wrong
like OS windows security policy to allow the user upto three attempt.
This is my code
------------------
Dim a As New DirectoryEntry("GC://domainname", Session("UName"),
Session("PWord"), AuthenticationTypes.Secure)
Dim searcher As New DirectorySearcher.FindOne()
Dim MyResultPropColl As ResultPropertyCollection(a,
"(&(objectCategory=user)(objectClass=person)(sAMAccountName=" +
Session("UName") + ")(!userAccountControl:1.2.850.113556.1.4.803:=2))") ',
"(&(anr=a-driches)(objectCategory=person))")
Dim sr As SearchResult = searcher. = sr.Properties
Dim myKey As String
For Each myKey In MyResultPropColl.PropertyNames
For Each mycollection As Object In MyResultPropColl(myKey)
If myKey = "memberof" Then
Cn.Add(mycollection.ToString)
End If
Next
Next
what shall I do for three attempt?
Regards,