Reputation: 31
I have searched around the web but could not find any solution.
Also, I have tried a lot of different solutions, but none works.
Please, keep an open mind while looking to this situation.
Requirements:
Assumptions:
Note:
The piece of VBS is working even asking for other users (not the one logged in).
I do not know about LDAP server configuration but the information above should make sense for those who knows it.
Piece of VBS code that is working fine:
Dim objSysInfo, objUser<br>
Set objSysInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objSysInfo.UserName)
MsgBox objUser.mail
How can I make it work?
Upvotes: 3
Views: 631
Reputation: 11026
Windows and the VBS APIs use a "SASL GSSAPI mechanism to achieve Single Sign-on (SSO)" form the client to a Active Directory Server.
There are many versions of Windows Active Directory and countless different methods that various parameters could be set in your implementation. So your success may vary.
I found an article that might help point you in the right direction: http://dmdaa.wordpress.com/2010/04/10/utilize-sasl-gssapi-mechanism-to-achieve-single-sign-on-sso-for-jndi-ldap-client/
Upvotes: 1
Reputation: 310980
The problem here is not the JNDI part, it is getting the user's login name in the same format as provided by ADSystemInfo.UserName
. You could see whether System.getProperty("user.name")
returns the right thing, otherwise you are into some ActiveX Bridge thing to emulate the VB code you posted.
The LDAP part just maps very straightforwardly into JNDI, you shouldn't have any problem with that part.
Upvotes: 2