I've got a Mac app written in Java. I'm trying to get the fully qualified domain name (LDAP) of the current user account from the system. The current user would be logged into the system through the active directory. 开发者_高级运维An example of the string I am after would be:
domain\john.doe@benq-lt.company.internal
Any assistance would be greatly appreciated!
I think the issue would be determining the userID within Active Directory. Once you had that, it should be pretty easy to determine the details of the user, assuming you had a LDAP connection to AD with proper permissions.
If the username of the user logged-in to the Mac is the samaccountName (or some other attribute within AD) you could read the local environment for the $USER and search for the value.
-jim
精彩评论