我怎样才能获得域名用户通过Active Directory登录到一台Mac一台、域名、用户、Active

2023-09-08 12:43:21 作者:习惯孤单

在我的可可应用程序怎么走时,他们通过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,用户的域。

我发现引用Directory服务和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.