コード例 #1
0
 /**
  * Get all users from Active Directory
  *
  * @return array|\Illuminate\Support\Collection
  * @throws \Exception
  */
 public function getAllUsers()
 {
     $provider = parent::connect();
     $search = $provider->search();
     return $search->users()->get();
 }
コード例 #2
0
 /**
  * return Active Directory Default Containers (Most used folders Users, Computers and Builtin)
  *
  * @return mixed
  * @throws \Exception
  */
 public function getDefaultContainers()
 {
     $provider = parent::connect();
     $search = $provider->search();
     return $search->orWhereEquals("cn", "Users")->orWhereEquals("cn", "Computers")->orWhereContains('cn', 'Builtin')->get();
 }