【问题标题】:Connecting to NTLM/LDAP on local machine on workgroup连接到工作组本地计算机上的 NTLM/LDAP
【发布时间】:2010-03-15 23:13:55
【问题描述】:

我对 NTLM/LDAP 非常陌生,并尝试使用在本地计算机上运行的 NTML 进行身份验证。微软提供的代码(http://support.microsoft.com/kb/326340/en-us)好像可以用,只是不知道怎么连接。

我知道身份验证服务正在运行,因为 Contos 8 已设置为使用 NTLM 进行身份验证并且它正在运行。我只是不知道“连接字符串”应该是什么:

我正在尝试:LDAP://CN=machinename 没有运气。

Dim adAuth As LdapAuthentication = New LdapAuthentication("LDAP://CN=LOCALMACHINENAME")
Dim entry As DirectoryEntry = New DirectoryEntry(_path, domainAndUsername, pwd)

建议?

【问题讨论】:

    标签: vb.net ldap ntlm


    【解决方案1】:

    在 .NET 3.5 中,您可以使用 PrincipalContext.ValidateCredentials 对域或计算机进行身份验证。

    Dim result as Boolean
    Using context As New PrincipalContext( ContextType.Machine, Nothing )
        result = context.ValidateCredentials( username, password )
    End Using
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多