开发者

Get Active Directory Domain Name For Current User Using Mac OSX

开发者 https://www.devze.com 2022-12-19 05:43 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消