getting user name from active directory

J

Joanne

Hello,
I'd like to be able to grab the user first name and last name from Active
Directory, to place in a form I've created. I'm not sure what kind of
connection to set up.

Thank you for any help you can provide.
 
J

Jean-Guy Marcil

Joanne was telling us:
Joanne nous racontait que :
Hello,
I'd like to be able to grab the user first name and last name from
Active Directory, to place in a form I've created. I'm not sure what
kind of connection to set up.

Thank you for any help you can provide.

See this thread for more info:
http://tinyurl.com/2owxbh

Here is something to get you going:

Dim objAdSys, objUser
Set objAdSys = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objAdSys.UserName)

MsgBox (objUser.Get("cn"))
MsgBox (objUser.Get("distinguishedName"))
MsgBox (objUser.Get("displayName"))
MsgBox (objUser.Get("initials"))
MsgBox (objUser.Get("mail"))
MsgBox (objUser.Get("department"))
MsgBox (objUser.Get("company"))
MsgBox (objUser.Get("title"))

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

Joanne

Merci!
Vous etes un ange!

Jean-Guy Marcil said:
Joanne was telling us:
Joanne nous racontait que :


See this thread for more info:
http://tinyurl.com/2owxbh

Here is something to get you going:

Dim objAdSys, objUser
Set objAdSys = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objAdSys.UserName)

MsgBox (objUser.Get("cn"))
MsgBox (objUser.Get("distinguishedName"))
MsgBox (objUser.Get("displayName"))
MsgBox (objUser.Get("initials"))
MsgBox (objUser.Get("mail"))
MsgBox (objUser.Get("department"))
MsgBox (objUser.Get("company"))
MsgBox (objUser.Get("title"))

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

Jean-Guy Marcil

Joanne was telling us:
Joanne nous racontait que :
Merci!
Vous etes un ange!

I know... If only I could convince my wife of the same!
;-)

Glad I could help.

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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