question

GlennSarsonas-6884 avatar image
0 Votes"
GlennSarsonas-6884 asked HannahXiong-MSFT answered

Caret character problem in Console Application

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:

113460-ldap.png


windows-active-directory
ldap.png (36.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GlennSarsonas-6884 avatar image
0 Votes"
GlennSarsonas-6884 answered

Need a little help. Pls? thanks ^_^

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HannahXiong-MSFT avatar image
0 Votes"
HannahXiong-MSFT answered

Hello @GlennSarsonas-6884,

Thank you so much for posting here.

So sorry that I am not professional with this issue. Hope someone could share their knowledge or experience here. If there is still no progress, I would suggest that we could contact Microsoft Customer Services and Support to get an efficient solution:

https://support.serviceshub.microsoft.com/supportforbusiness

Thanks for your understanding and support.

Best regards,
Hannah Xiong

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.