logged in windows username cant be searched in LDAP tree on Windows 2000 AD

That is my active directory of myTESTWindows 2000 server:

http://img248.imageshack.us/img248/918/adwn6.gif

On the image yu will find 4 schools with shortcut names called:

OU=ASR

OU=EDS

OU=EKS (EK school for example)

OU=THS (TH school for example)

Under every OU="shortcut of schoolname" you will find also the

OU=Klassen (Klassen = classes in english)

OU=Lehrer (Lehrer = teacher in english)

again under every OU="class" and OU="teacher" you will find also the

pupils and teachers.

the teacher "verena bit" is located in:

"CN=verena bit,OU=Lehrer,OU=ASR,DC=Bodensee,DC=DE"

On theREAL Windows 2000 server used in production i have about 17 schools like OU=ASR or OU=EDS and so on...

My part aim for the first...:

With Java code: String Lehrer = System.getProperty("user.name");

I can retrieve the name of the teacher (Lehrer = teacher) who has logged into the Windows client. The problem is i get for example a String like

"verenabit" but in the ldap hierarchy all common names are for example like this: cn="verena bit" they have always a " " gap between the forename and the lastname so I can not use the String "verenabit" to search for it in the ldap tree as she would not exist right?

What i finally want is to find out the OU="shortcut of schoolname" (see above) by searching for the logged in teacher. So when i have OU="shortcut of schoolname" of the teacher i am able to read ONLY the usernames(teachers+pupils) of that specific school and not all teacher+pupils of all 17 schools what would be about 8000 users :-D

Can someone help me please how can i use the username of the logged in windows user and search him effectively in the ldap tree on my test windows 2000 server.

Steven you want all my points? ROFL ;-)

[1895 byte] By [4tha] at [2007-11-27 10:06:12]
# 1

Here's a hint.

Use a generic ldap tool (for example ldp.exe which is included in Windows Server, or whatever your favourite ldap browser is, and find the object in the Active Directory that corresponds to the user named Verna Bit.

Believe it or not, you will find an attribute which has matching value to that returned from System.getProperty("user.name");

Then you just need to construct the relevant LDAP Query Filter.

It ain't rocket science !

Good luck.

adler_stevena at 2007-7-13 0:42:23 > top of Java-index,Core,Core APIs...
# 2

> Here's a hint.

>

> Use a generic ldap tool (for example ldp.exe which is

> included in Windows Server, or whatever your

> favourite ldap browser is, and find the object in the

> Active Directory that corresponds to the user named

> Verna Bit.

>

> Believe it or not, you will find an attribute which

> has matching value to that returned from

> System.getProperty("user.name");

>

> Then you just need to construct the relevant LDAP

> Query Filter.

>

> It ain't rocket science !

>

> Good luck.

Yes i already use ldp.exe i installed it from the win2k server CD its a great tool :)

hm your hint is odd or how can i say dont know wether you really understood me, because what you suggested to me is actually what i doubted that it could work. Seems you have more faith?

The problem is (not sure wether you really understood me...) that when i search the whole Directory having 8000 user, I could search for teachers only which are in OU=Lehrer (Lehrer = teacher) and just go one childnode down but "verena bit" IS NOT "verenabit". I cannot search for the username verenatbit as i wont get any result as it does not exist.

4tha at 2007-7-13 0:42:24 > top of Java-index,Core,Core APIs...
# 3
ok it seems i found a solution i will test it and show it later when it works...
4tha at 2007-7-13 0:42:24 > top of Java-index,Core,Core APIs...