Connecting to NTLM/LDAP on local machine on workgroup
I am very new to NTLM/LDAP and trying to authenticate using NTML running on a local machine. The code provided by Microsoft ( http://support.microsoft.com/kb/326340/en-us ) seems to work, I just do not know how to connect to it.
I know that the authentication service is running because Contos 8 has been set up to authenticate using NTLM and it is working. I just do not know what the "connection string" should be:
I am trying: LDAP://CN=machinename with no luck.
Dim adAuth As LdapAuthentication = New LdapAuthentication("LDAP://CN=LOCALMACHINENAME")
Dim entry As DirectoryEntry = New DirectoryEntry(_path, domainAndUsername, pwd)
Sugge开发者_开发技巧stions?
In .NET 3.5 you can authenticate against a domain or machine using PrincipalContext.ValidateCredentials.
Dim result as Boolean
Using context As New PrincipalContext( ContextType.Machine, Nothing )
result = context.ValidateCredentials( username, password )
End Using
精彩评论