Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Active Directory Domain Name For Current User Using Mac OSX

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\[email protected]

Any assistance would be greatly appreciated!

like image 267
bberak Avatar asked Nov 14 '22 13:11

bberak


1 Answers

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

like image 64
jwilleke Avatar answered Dec 18 '22 10:12

jwilleke