Hi All.
I want to check if my Connection was successfull to the AD. I know my problem is getting the value of "de.Path".
Please assist
See code below
Code
{
Public Shared Function GetDirectoryEntry() As DirectoryEntry Dim de As DirectoryEntry = New DirectoryEntry() 'Connect to my serverde.Path =
"LDAP://SERVER/OU=Groups;DC=MY DOMAIN;" 'login Detailsde.Username =
"DOMAIN\USERNAME"de.Password =
"PASSWORD"de.AuthenticationType = AuthenticationTypes.Secure
Return de End Function Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim de As DirectoryEntry = New DirectoryEntry() 'Checking if Connection Is being Established If de.Equals(0) ThenMessageBox.Show(
"Not Connected.....") ElseMessageBox.Show(
"Connected......") End If End SubEnd
Class}
Replies
Know the answer? Post it — somebody with the same question will find it here.