PHPackages                             alaneor/ad-x - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. alaneor/ad-x

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

alaneor/ad-x
============

X-tremely powerful Active Directory interface for php

0.3.4(10y ago)402.8k8[5 issues](https://github.com/Alaneor/AD-X/issues)BSD-3PHPPHP &gt;=5.4.0

Since Jul 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Alaneor/AD-X)[ Packagist](https://packagist.org/packages/alaneor/ad-x)[ Docs](https://github.com/Alaneor/AD-X)[ RSS](/packages/alaneor-ad-x/feed)WikiDiscussions master Synced today

READMEChangelog (8)Dependencies (2)Versions (11)Used By (0)

AD-X :: Active Directory library for php
========================================

[](#ad-x--active-directory-library-for-php)

The **AD-X** library aims to provide an easy-to-use, object-oriented and powerful tool to work with Active Directory and related components, like Exchange.

Features
--------

[](#features)

### The important ones

[](#the-important-ones)

---

- An understandable, object-oriented API to work with Active Directory
- **Automatic data conversion** - with this library, you won't encounter a value that has to be converted to something else before you can work with it in php ( like `unicodePwd` or `lastLogonTimestamp` ) - you simply use the values and the library will take care of the conversion
- [User management](http://alaneor.github.io/AD-X/api/class-ADX.Classes.User.html) / **Microsoft Exchange mailbox management** ( yes, you can create Exchange mailboxes / mail users with this! )
- Support for paged searches
- Support for referrals - useful if you operate on multiple domains in a forest
- TLS or SSL encryption support
- Directory Schema caching allows to perform checks, validations and provide guidance before you even attempt to modify anything on the server
- Simple [change tracking](http://alaneor.github.io/AD-X/api/class-ADX.Core.Task.html#_changes) on your directory server
- [Selectors](http://alaneor.github.io/AD-X/api/class-ADX.Util.Selector.html) - a simple and elegant way to retrieve objects

### The nice to have ones

[](#the-nice-to-have-ones)

---

- *ldap v3* protocol support
- Namespaced classes to prevent collisions
- Exceptions-based error handling
- Autoloading support via Composer
- Object-to-json conversion for easy integration with your front-end
- Optional simple ldap query builder

Installation
------------

[](#installation)

### Requirements

[](#requirements)

- PHP 5.4.0 and newer with LDAP support ( [setup instructions](http://www.php.net/manual/en/ldap.installation.php) )
- OpenSSL module for SSL / TLS connections ( [setup instructions](http://cz1.php.net/manual/en/openssl.installation.php) )

### Install:

[](#install)

#### Via Composer:

[](#via-composer)

This will install the latest stable release:
`composer require alaneor/ad-x:dev-master`( visit [Packagist](https://packagist.org/packages/alaneor/ad-x) for list of all available versions )

### Post-installation ( optional, but **strongly recommended** ) :

[](#post-installation--optional-but-strongly-recommended--)

#### Generate the schema cache:

[](#generate-the-schema-cache)

Create a new php script with the following contents, providing relevant information like domain and your domain credentials:

```
    include './vendor/autoload.php'; // Include Composer's autoloader

    $link = new ADX\Core\Link( 'company.com', 389 ); // Connect to server on default port
    $link->bind( 'username@company.com', 'password' ); // Authenticate to the server
    ADX\Core\Schema::build( $link ); // Build the local schema cache ( takes some time, go get a coffee )
```

A future release will include a wizard-like script to guide you through the process right after installation.

Depending on the stability of your Active Directory environment, you might need to re-build the schema cache occasionally, especially after upgrading to a newer Active Directory functional level or after installing new directory-related components, like MS Exchange, OCS Services or similar.

Documentation
-------------

[](#documentation)

Documentation is currently available for the API only, but it includes a lot of examples and explanations. I recommend that you read the documentation in the following order:

- [Link](http://alaneor.github.io/AD-X/api/class-ADX.Core.Link.html) : How to connect to the directory and perform authentication
- [Task](http://alaneor.github.io/AD-X/api/class-ADX.Core.Task.html) : How to search the directory and retrieve data
- [Object](http://alaneor.github.io/AD-X/api/class-ADX.Core.Object.html) : How to work with retrieved objects and read/manipulate its attributes
- [Attribute](http://alaneor.github.io/AD-X/api/class-ADX.Core.Attribute.html) : How to manipulate individual attributes and read/manipulate its values
- [User](http://alaneor.github.io/AD-X/api/class-ADX.Classes.User.html) : How to work with users and manage Exchange mailboxes / mail users

### Read online: [API documentation](http://alaneor.github.io/AD-X/api)

[](#read-online-api-documentation)

### Generate the documentation locally:

[](#generate-the-documentation-locally)

1. Download the library
2. Install the dependencies using [Composer](http://getcomposer.org/):

```
composer install --dev

```

1. Generate the API documentation using [ApiGen](http://apigen.org/) ( installed by Composer ):

```
php ./vendor/bin/apigen.php

```

1. Generated documentation will be available at *./docs/www/index.html*

Known limitations
-----------------

[](#known-limitations)

- The *ldap v2* protocol is not supported and never will be. Pull requests to provide backwards-compatibility will be refused.
- The library has been built **specifically for Active Directory**. Compatibility with standards-based ldap servers like [OpenLDAP](http://openldap.org) is likely broken. I have no plans to address this at the moment but a future release might make such thing possible.
- Unit tests are missing completely. I realise this might be a serious issue for future development and plan to address this with a future update. Any help with writing tests is much appreciated.

Future to-dos
-------------

[](#future-to-dos)

- Improve the API documentation
- Provide "helper" classes to simplify working with computers, groups, contacts etc.
- Write unit tests
- Write tutorials

Found an issue / have idea?
---------------------------

[](#found-an-issue--have-idea)

Please submit issues and ideas to the Github's [issue tracker](https://github.com/Alaneor/AD-X/issues).

Contributing rules will be provided in a future update - for now, please try to match the programming style currently used in the code when submitting pull requests.

License
-------

[](#license)

This software is licensed under the **BSD (3-Clause) License**. See the [LICENSE](LICENSE) file for more information.

Appreciate
----------

[](#appreciate)

If you like this project and enjoy using it, feel free to spread the word about it wherever you wish.

You may also consider donating.

### Via Flattr:

[](#via-flattr)

[![Flattr this](https://camo.githubusercontent.com/7e3f46a36526479d701ef7f90a0f8c3ac2fbab3087446e2a9fceed75cd1ab802/687474703a2f2f6170692e666c617474722e636f6d2f627574746f6e2f666c617474722d62616467652d6c617267652e706e67 "Flattr this")](http://flattr.com/thing/1301881/)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~132 days

Recently: every ~253 days

Total

9

Last Release

3676d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4300d8bf145f9d0db6e15c90199842aad7541376402c2fc2ee86539631100bc4?d=identicon)[Alaneor](/maintainers/Alaneor)

---

Top Contributors

[![robertrossmann](https://avatars.githubusercontent.com/u/3058150?v=4)](https://github.com/robertrossmann "robertrossmann (170 commits)")[![lillesvin](https://avatars.githubusercontent.com/u/169406?v=4)](https://github.com/lillesvin "lillesvin (1 commits)")

---

Tags

ldapactive directory

### Embed Badge

![Health badge](/badges/alaneor-ad-x/health.svg)

```
[![Health](https://phpackages.com/badges/alaneor-ad-x/health.svg)](https://phpackages.com/packages/alaneor-ad-x)
```

###  Alternatives

[symfony/ldap

Provides a LDAP client for PHP on top of PHP's ldap extension

1367.9M56](/packages/symfony-ldap)[adldap/adldap

A PHP LDAP Library for Active Directory Manipulation

424171.2k9](/packages/adldap-adldap)[ldaptools/ldaptools

LdapTools is a feature-rich LDAP library for PHP 5.6+.

205267.5k1](/packages/ldaptools-ldaptools)[freedsx/ldap

A Pure PHP LDAP library

157146.9k2](/packages/freedsx-ldap)[avadaneidanut/ldapquery

A light weight package for easily building LDAP advanced filter queries.

4718.3k](/packages/avadaneidanut-ldapquery)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
