Connecting to Active Directory

  • Thread starter Thread starter MadCrazyNewbie
  • Start date Start date
M

MadCrazyNewbie

Hey Group,

Hope Somebody could possibly help?

I would like to be able to connect to our Windows 2000 Active Directory,
download a list of users and import it into a access database?

Only Problem is, if the user already exsists in the Access Table, I don`t
want it to import the user again. Only the users that have been added to the
W2k AD since my last import. The only feild I want from AD is Display Name.

Is this possible? Anybody got any examples?

Many Thanks
Si
 
Here's a simple example of how to query AD.
http://www.knowdotnet.com/articles/directoryservices.html You can use the
DirectoryServices namespace. I'd iterate through it and either get the list
of existing users beforehand and then check against it before I do my
additions or do the check before I try to enter them. Find a good PK value
to ensure no dupes make it in there.

There may be a direct import function, but I don't know AD all that well and
from what i know query Access and doing the checks isn't supported natively

Bill

www.devbuzz.com
www.knowdotnet.com
 
William Thanks for you reply, when I try to run the code it tells me:

D:\test1\Form1.vb(59): Type 'DirectoryEntry' is not defined.
D:\test1\Form1.vb(61): Type 'WindowsIdentity' is not defined.

Any Ideas?

Many Thanks
MCN
 
Imports System.DirectoryServices

MadCrazyNewbie said:
William Thanks for you reply, when I try to run the code it tells me:

D:\test1\Form1.vb(59): Type 'DirectoryEntry' is not defined.
D:\test1\Form1.vb(61): Type 'WindowsIdentity' is not defined.

Any Ideas?

Many Thanks
MCN
 
Hi William, i`ve put Imports System.DirectoryService at the top of my page
but now get:

D:\Test Apps\test1\Form1.vb(1): Namespace or type 'DirectoryServices' for
the Imports 'System.DirectoryServices' cannot be found.

Any Ideas? Many Thanks for any help in advance

Ta
MCN
 
Go to Project and select Add Reference. From there, under the .NET
references, reference System.DirectoryServices.dll
 
Back
Top