current user object

  • Thread starter Thread starter martin meister
  • Start date Start date
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
 
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
 
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.
 
Back
Top