如何获取通过Active Directory登录到Mac的用户的域名 [英] How can I get the domain name for a user logged into a Mac via Active Directory
本文介绍了如何获取通过Active Directory登录到Mac的用户的域名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的Cocoa应用程序中,当他们通过Active Directory登录时,如何获取当前用户的域?
In my Cocoa app how can I get the current user's domain when they're logged in via Active Directory?
我需要确定两件事:
- 如果当前用户登录到Active Directory域(只需要处理Active Directory)。
- 如果1,用户的域。
我发现引用目录服务和打开目录编程指南,但后者仅为10.6(我必须支持10.5+),我找不到任何例子,让我知道我需要做什么。
I've found references to Directory Services and the Open Directory Programming Guide but the latter is 10.6 only (I must support 10.5+) and I could not find any examples for the former that gave me an idea of what I needed to do.
推荐答案
dsconfigad -show
dsconfigad -show
它会告诉你是否绑定到目录和绑定的目录的详细信息。然后你会知道如何脚本dscl。
It will tell whether you are bound to a directory and details about that directory if bound. Then you will know how to script dscl.
这篇关于如何获取通过Active Directory登录到Mac的用户的域名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文