Virtual List View (VLV) allows you as the LDAP application developer to query a very large directory container in efficient and bite-sized chunks. Virtual List View is enabled by default on eDirectory.
Enabling Virtual List View on Active Directory:
Click Start > Run type Adsiedit.msc, and ENTER.
In the ADSI Edit tool, expand the Configuration[DomainController] node.
Expand the CN=Configuration,DC=DomainName container.
Expand the CN=Services object.
Expand the CN=Windows NT object.
Right-click the CN=Directory Service object.
Click Properties.
In the Attributes list, click msds-Other-Settings > Edit.
In the Values list, click any instance of DisableVLVSupport=x where x is not equal to 0, and click Remove.
Click OK twice. Close the ADSI Edit tool.
Installing schema and sort control:
Open a command prompt and type regsvr32 schmmgmt.dll command, and then press ENTER:
Click Start > Run.
Type mmc and then click OK.
On the File menu, click Add/Remove Snap-in.
In the Available snap-ins field, click Active Directory Schema > Add > OK.
Click on the created schema search for cn → properties → enable. Index this attribute for containerized searches.
Enabling Virtual List View on OpenLDAP:
Bind to the server that you want to perform the search on using ldap_bind or ldap_bind_s.
Set the members for LDAPVLVInfo and create the control using ldap_create_vlv_control.
Create a sort control using ldap_create_sort_control and add it to an array with the VLV control.
Perform a search on the server using ldap_search_ext_s or ldap_search_ext.
Parse the results from the server using ldap_parse_result, then parse the vlv results received from the response control (LDAP_CONTROL_VLVRESPONSE) using ldap_parse_vlv_control.
Free the control using ldap_control_free.