To get the Root DSE of your AD server, call the getRootDse()
method off a new search:
$rootDse = $provider->search()->getRootDse();
To get the Root DSE schema naming context, call the getSchemaNamingContext()
:
$rootDse = $provider->search()->getRootDse();
$context = $rootDse->getSchemaNamingContext();
// Returns 'cn=Schema,cn=Configuration,dc=corp,dc=acme,dc=org'
echo $context;
To get the Root DSE domain naming context, call the getRootDomainNamingContext()
:
$context = $rootDse->getRootDomainNamingContext();
// Returns 'dc=corp,dc=acme,dc=org'
echo $context;