Hi! I'm having a little trouble with the caret (^) character.
I'm creating a vb.net console application to verify an AD user.
Imports System.DirectoryServices.AccountManagement
Module Module1
Sub Main(ByVal args() As String)
Dim isWithAD As Boolean
Try
Dim pc As PrincipalContext = New PrincipalContext(ContextType.Domain, "<AD Domain Here>")
Using (pc)
isWithAD = pc.ValidateCredentials(args(0), args(1))
End Using![113447-ldap.png][1]
Console.WriteLine(IIf(isWithAD = True, "Success", "Failed"))
Catch ex As Exception
Console.WriteLine("Error [" + ex.ToString + "] - " + ex.InnerException.ToString)
End Try
End Sub
End Module
The problem is when the password has a caret character at the end (E.g. zpfrt^), it returns a FALSE value. Even I tried to enclosed it in [], (), "", and {}, it doesn't solve the problem. I also tried this one - ^^^^, it still not working.
Do you have any idea how to fix this?
Please let me know if you have a solution. Thanks in advance guys :)
Example:
