i now got all groups and all users and everything you need from ldap , there is afree class on internet adldap class ,here is the link :
http://adldap.sourceforge.net/download.php
there is many versions i used version 2.1 in the folder there is a file called examples you can uncomment any script to use it , it uses all function which are defined in adldap file(which is the class), examples.php includes the class , and starts using functions.
you have to open adldap class and edit the connect and bind functions and set them to you'r domain and user name and password.
you have to set you'r info in these lines in the adldap class in the constructor
//connect to the LDAP server as the username/password
$dc=$this->random_controller();
if ($this->_use_ssl){
$this->_conn = ldap_connect("mydomain.com");
} else {
$this->_conn = ldap_connect($dc);
}
//bind as a domain admin if they've set it up
if ($this->_ad_username!=NULL && $this->_ad_password!=NULL){
$this->_bind = @ldap_bind($this->_conn,"user@mydomain.com","pw");
//bind as the user
$this->_bind = @ldap_bind($this->_conn,"user@mydomain.com","pw");
if (!$this->_bind){ return (false); }
and because the informations returned sometimes very larg you have to add this line in the begining of the class
ini_set("memory_limit","17M");
which gives 17 mega byte for results .
thank you w_3rabi for you'r help ..