src/Classes/AdldapExchange.php
public function storageGroups($exchangeServer, $attributes = ['cn', 'distinguishedname'], $recursive = null)
    {
        $this->adldap->utilities()->validateNotNull('Exchange Server', $exchangeServer);

        $this->adldap->utilities()->validateLdapIsBound();

        if ($recursive === null) {
            $recursive = $this->adldap->getRecursiveGroups();
        }

        $filter = "(&(objectCategory=$this->storageGroupObjectCategory))";

        $results = $this->connection->search($exchangeServer, $filter, $attributes);

        if ($results) {
            $entries = $this->connection->getEntries($results);

            if ($recursive === true) {
                for ($i = 0; $i < $entries['count']; $i++) {
                    $entries[$i]['msexchprivatemdb'] = $this->storageDatabases($entries[$i]['distinguishedname'][0]);
                }
            }

            return $entries;
        }

        return false;
    }
public function storageGroups($exchangeServer, $attributes = ['cn', 'distinguishedname'], $recursive = null)
    {
        $this->adldap->utilities()->validateNotNull('Exchange Server', $exchangeServer);

        $this->adldap->utilities()->validateLdapIsBound();

        if ($recursive === null) {
            $recursive = $this->adldap->getRecursiveGroups();
        }

        $filter = "(&(objectCategory=$this->storageGroupObjectCategory))";

        $results = $this->connection->search($exchangeServer, $filter, $attributes);

        if ($results) {
            $entries = $this->connection->getEntries($results);

            if ($recursive === true) {
                for ($i = 0; $i < $entries['count']; $i++) {
                    $entries[$i]['msexchprivatemdb'] = $this->storageDatabases($entries[$i]['distinguishedname'][0]);
                }
            }

            return $entries;
        }

        return false;
    }
public function storageGroups ( $ exchangeServer , $ attributes = [ 'cn' , 'distinguishedname' ] , $ recursive = null ) { $ this -> adldap -> utilities ( ) -> validateNotNull ( 'Exchange Server' , $ exchangeServer ) ; $ this -> adldap -> utilities ( ) -> validateLdapIsBound ( ) ; if ( $ recursive === null ) { $ recursive = $ this -> adldap -> getRecursiveGroups ( ) ; } $ filter = "(&(objectCategory=$this->storageGroupObjectCategory))" ; $ results = $ this -> connection -> search ( $ exchangeServer , $ filter , $ attributes ) ; if ( $ results ) { $ entries = $ this -> connection -> getEntries ( $ results ) ; if ( $ recursive === true ) { for ( $ i = 0 ; $ i < $ entries [ 'count' ] ; $ i ++ ) { $ entries [ $ i ] [ 'msexchprivatemdb' ] = $ this -> storageDatabases ( $ entries [ $ i ] [ 'distinguishedname' ] [ 0 ] ) ; } } return $ entries ; } return false ; }
Returns a list of Storage Groups in Exchange for a given mail server.

@param string $exchangeServer The full DN of an Exchange server.  You can use exchange_servers() to find the DN for your server
@param array  $attributes     An array of the AD attributes you wish to return
@param null   $recursive      If enabled this will automatically query the databases within a storage group

@return bool|array
Returns a list of Storage Groups in Exchange for a given mail server .