Tuesday, July 21, 2009

Making VB Connection to Active Directory [Code]

"Making a Connection" to a Directory is simple. Reading information is simple. Writting the information is harder. Those are not as key know what to get and what to do with it.
Here are the lines I use to read Active Directory and that should help in setting the stage for a good start.

Code

Imports System.DirectoryServices
Imports System.Diagnostics
Dim ad001 As New DirectoryEntry

("LDAP://domainname.com/cn=TheReadAccnt,ou=accounts,dc=domainname,dc=com", "AdminAccnt", "ThePassword")

Dim adDescrpt001 As String = ad001.Properties("description").Value.ToString()

No comments:

Post a Comment