• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Determining the ActiveDirectory domain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: NSURLRequest/connection timing
  • Next by Date: Mysterious crash in MultiplexerSource::_wakeupRunLoop (iOS 4.3)
  • Previous by thread: Re: NSURLRequest/connection timing
  • Next by thread: Mysterious crash in MultiplexerSource::_wakeupRunLoop (iOS 4.3)
  • Index(es):
    • Date
    • Thread