/** * Get the default address list for the domain forest * * @return Object The default global address list */ public function defaultGAL() { if ($this->gal instanceof Object) { return $this->gal; } $task = new \ADX\Core\Task(Enums\Operation::OpSearch, $this->link); $gal = $task->base(static::$base)->filter(q::a(['objectCategory' => 'msExchConfigurationContainer']))->attributes('globalAddressList')->run()->first(); $this->gal = Object::read($gal->globalAddressList(0), static::$attributes, $this->link); return $this->gal; }
/** * Read information from the RootDSE entry * * Use this method to read information from the RootDSE entry of the directory server. * * The following information ( each represented as {@link Attribute} ) * is always available: * * - dnshostname * - defaultnamingcontext * - highestcommittedusn * - supportedcontrol * - supportedldapversion * - supportedsaslmechanisms * - rootdomainnamingcontext * - configurationnamingcontext * - schemanamingcontext * - namingcontexts * - currenttime * * <br> * Note that you do not need to use this method each time * you need to read information from rootDSE - simply access the information * straight away via `$link->rootDSE->property_name()` and the class will take * care of the rest. In fact, accessing the property is faster because the library * caches to rootDSE information for you and only reloads when calling this method. * * <h4>Example</h4> * <code> * $link = new Link( 'example.com' ); // Connect to server * $object = $link->rootDSE(); // Load default attribute set from the RootDSE * // Do something with Object... * $currentTime = $object->currentTime->value(0); * </code> * * @see <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms684291%28v=vs.85%29.aspx">MSDN - RootDSE</a> * @uses Object::read() * @param string|array One or more attributes you wish to have retrieved in addition to the default set * * @return Object The Object representing the RootDSE entry with requested attributes */ public function rootDSE($attributes = []) { $get = ['dnshostname', 'defaultnamingcontext', 'highestcommittedusn', 'supportedcontrol', 'supportedldapversion', 'supportedsaslmechanisms', 'rootdomainnamingcontext', 'configurationnamingcontext', 'schemanamingcontext', 'namingcontexts', 'currenttime']; $attributes = array_merge($get, (array) $attributes); // Read the rootDSE $this->rootDSE = Object::read('', $attributes, $this); return $this->rootDSE; }