我怎样才能获得域名用户通过Active Directory登录到一台Mac [英] How can I get the domain name for a user logged into a Mac via Active Directory
问题描述
在我的可可应用程序怎么走时,他们通过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,用户的域。
我发现引用<一个href="http://developer.apple.com/Mac/library/documentation/Networking/Reference/Open%5FDirectory%5FRef/Reference/reference.html">Directory服务和<一href="http://developer.apple.com/mac/library/documentation/Networking/Conceptual/Open%5FDirectory/Introduction/Introduction.html">Open目录编程指南,但后者只为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屋!