current user object

M

martin meister

Hi all!

Is there a simple ldap-query to get the ad user-object for
the logged on user (without ou..., only with the rdn)?
Simple means "ldap://rdn=martin", but
not "ldap://cn=..,ou=..,ou=..,ou=..,cn=..,cn=.."

I don´t know how to determine in which ou the loggend on
user resides. I think it´s also not practicable to search
the AD for the current loggend on user.

martin
 
M

Matjaz Ladava [MVP]

You could use WinNT provider for this:

Set netObj = CreateObject("WScript.Network")
domain = netObj.UserDomain
user = netObj.UserName
Set userObj = GetObject("WinNT://" & domain & "/" & user & ",user")

in userObj you now have user objects properties (current user) which you can
read and manipulate.

--
Regards

Matjaz Ladava, MCSE (NT4 & 2000), Windows MVP
(e-mail address removed)
http://ladava.com

Hi all!

Is there a simple ldap-query to get the ad user-object for
the logged on user (without ou..., only with the rdn)?
Simple means "ldap://rdn=martin", but
not "ldap://cn=..,ou=..,ou=..,ou=..,cn=..,cn=.."

I don´t know how to determine in which ou the loggend on
user resides. I think it´s also not practicable to search
the AD for the current loggend on user.

martin
 
P

Paul Myers

But that does not give access to properties like
TelephoneNumber and OfficeLocation. Or am is there
something else I need to do? I want to use the user logon
name to display these properties for the user to update
there own information. Any help would be greatly
appreciated. I have looked every where I can think of to
find this out.
 

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