Determining the ActiveDirectory domain
Determining the ActiveDirectory domain
- Subject: Determining the ActiveDirectory domain
- From: Matt Slot <email@hidden>
- Date: Sat, 17 Sep 2011 02:09:02 -0400
I need to discover if the user is bound to an ActiveDirectory domain, and if so, the name of that domain. The OpenDirectory APIs are interesting, but navigating the data structures is pretty opaque.
I currently do the following:
ODNodeRef nodeRef = ODNodeCreateWithName(NULL, kODSessionDefault, CFSTR("/Active Directory"), NULL);
CFArray arrayRef = ODNodeCopySubnodeNames(nodeRef, NULL);
And this returns the domain name, but when I do anything with that node...
CFStringRef subnodeName = CFArrayGetValueAtIndex(subnodeNames, 0);
ODNodeRef subnodeRef = ODNodeCreateWithName(NULL, kODSessionDefault, subnodeName, &errorRef);
I get kODErrorNodeConnectionFailed -> "Connection failed to node '/Active Directory/MYDOMAIN'"
Am I overthinking this and I just need the name, or way off the mark?
Thanks!
Matt _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden