Enumerate all users in LDAP with PHP

前端 未结 5 465
一整个雨季
一整个雨季 2020-12-15 08:48

I\'d like to create a php script that runs as a daily cron. What I\'d like to do is enumerate through all users within an Active Directory, extract certain fields from each

5条回答
  •  遥遥无期
    2020-12-15 09:40

    This isn't a full answer, but this guy was able to do it. I don't understand what he did, though.

    By the way, a partial answer is that you CAN get "pages" of results. From the documentation:

    resource ldap_search ( resource $link_identifier , string $base_dn ,
         string $filter [, array $attributes [, int $attrsonly [, int $sizelimit [, 
         int $timelimit [, int $deref ]]]]] )
    ...
    

    sizelimit Enables you to limit the count of entries fetched. Setting this to 0 means no limit.

    Note: This parameter can NOT override server-side preset sizelimit. You can set it lower though. Some directory server hosts will be configured to return no more than a preset number of entries. If this occurs, the server will indicate that it has only returned a partial results set. This also occurs if you use this parameter to limit the count of fetched entries.

    I don't know how to specify that you want to search STARTING from a certain position, though. I.e., after you get your first 1000, I don't know how to specify that now you need the next 1000. Hopefully someone else can help you there :)

提交回复
热议问题