PHP code example of gubler / ad-search-bundle

1. Go to this page and download the library: Download gubler/ad-search-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gubler / ad-search-bundle example snippets


public function __construct(private ADSearchService $adSearch)
{
}

public function search () {
    // find all that match a search term
    $arrayOfUsers = $this->adSearch->search('name');

    // find one by GUID
    $guid = Uuid::fromString('192D7590-6036-4358-9239-BEA350285CA2');
    $singleUser = $this->adSearch->find($guid);

    // find one by search term
    $singleUser = $this->adSearch->findBy('samaccountname', 'User');
}