What can I get from the AD

C

Colin S.

The code at the bottom is able to pull information back from the AD
about the current user. I need more, but dont know what else I can
request. Is there a way I can list the properties available to me?
I've tried adding this:

For Each Item In objUser
Debug.Print objUser.Item
Next

But the macro skipped right over it. Any idea?

Thanks,

Colin



Sub GetADinfo()

Dim objSysinfo As Object
Dim objUser As Object

Dim strUser As String 'Distinguished Name

Set objSysinfo = CreateObject("ADSystemInfo")
strUser = objSysinfo.UserName
Set objUser = GetObject("LDAP://" & strUser)

debug.print objUser.get("Title")
debug.print objUser.get("department")
debug.print objUser.get("telephonenumber")
debug.print LCase(objUser.get("mail"))

End Sub
 
G

Graham Mayor

If you liked that add-in, you will love its replacement. Probably available
tomorrow :)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top