I am afraid I personally know little about Active Directory. This article
shows what to reference and what the name of the help file is - where you
should be able to get some of the information you need.
http://support.microsoft.com/default...b;en-us;194115
How To Use ADSI in
VB to Enumerate the Computers in an NT Domain
ADSI Help file (ADSI.HLP)
In the ADSI Help file Contents, choose Guide - Introduction to Active
Directory Service Interfaces - Code Examples - Automation examples and
ADsPaths examples for more Visual Basic code examples.
The reference would be set to
ActiveDS
(the type library file is ActiveDS.tlb)
The Active DS Type Library provides the ADSI object model.
It has a link to these if it isn't installed on your machine.
--
Regards,
Tom Ogilvy
"Dr Alric" wrote in message
...
Hi There
I tried to follow the article posted, but I am still hitting a problem
this is my code
Set oTargetOU = GetObject("LDAP://DC=topics.co.za")
x = 1
oTargetOU.Filter = Array("user")
For Each usr In oTargetOU
If InStr(usr.SamAccountName, "$") = 0 Then
Cells(x, 1) = usr.get("Sn")
Cells(x, 2) = usr.get("GivenName")
x = x + 1
End If
Next
It falls over on the first line with the message:
a referral was returned from the server
Is there something wrong with my syntax or am I missing a reference
somewhere?
"Tom Ogilvy" wrote in message
...
this article describes how to switch lastname and firstname (usng
windows
scripting host), so you could probably skip the PUT part and it should
be
a
start:
http://support.microsoft.com/default...b;en-us;277717
How to Change the Display Names of Active Directory Users with Active
Directory Services Interface Script
--
Regards,
Tom Ogilvy
"Dr Alric" wrote in message
...
Hi There
I am looking for the code for a macro to be able to extract the
Firstname's,
surname's and userid from our companies active directorie and put these
into
an excel worksheet.
Would anybody be able to help me with this, or point me to a reference
for
the syntax?
Thanks