How can I get the domain name for a user logged into a Mac via Active Directory
- by Lawrence Johnston
In my Cocoa app how can I get the current user's domain when they're logged in via Active Directory?
I need to determine two things:
1. If the current user is logged on to an Active Directory domain (only need to handle Active Directory).
2. If 1, the domain of the user.
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.