The RANGE parameter

First we will look at a general search using ldapsearch command using a range parameter

Published

Goal

The goal is to learn how to use the range parameter in such a way that the results can be interpreted by a vbscript program.

Steps

ldapsearch  -o ldif-wrap=no -LLL -H ldap://my-domain-controller:389 -x -D "my-domain\my-account" -w my-password -s base -b "CN=Adobe,OU=Groups,OU=Org,DC=my-domain,DC=LOCAL" "samaccountname" "member;range=0-*" 
member;range=0-1499: CN=JackJ,OU=Users,OU=Org,DC=My-Domain,DC=LOCAL
member;range=0-1499: CN=JillD,OU=Users,OU=Org,DC=My-Domain,DC=LOCAL
member;range=0-1499: CN=JohnDoe,OU=Users,OU=Org,DC=My-Domain,DC=LOCAL
...

 

 

ldapsearch  -o ldif-wrap=no -LLL -H ldap://my-domain-controller:389 -x -D "my-domain\my-account" -w my-password -s base -b "CN=Adobe,OU=Groups,OU=Org,DC=my-domain,DC=LOCAL" "samaccountname" "member;range=1500-*" 
member;range=1500-2999: CN=Pianoman,OU=Users,OU=Org,DC=My-Domain,DC=LOCAL
member;range=1500-2999: CN=Motordude,OU=Users,OU=Org,DC=My-Domain,DC=LOCAL
member;range=1500-2999: CN=JohnTheHacker,OU=Users,OU=Org,DC=My-Domain,DC=LOCAL
...

ldapsearch  -o ldif-wrap=no -LLL -H ldap://my-domain-controller:389 -x -D "my-domain\my-account" -w my-password -s base -b "CN=Adobe,OU=Groups,OU=Org,DC=my-domain,DC=LOCAL" "samaccountname" "member;range=3000-*" 
member;range=3000-*: CN=RoseTheManager,OU=Users,OU=Org,DC=My-Domain,DC=LOCAL
member;range=3000-*: CN=SalesPerson,OU=Users,OU=Org,DC=My-Domain,DC=LOCAL
member;range=3000-*: CN=CarDriver,OU=Users,OU=Org,DC=My-Domain,DC=LOCAL
...

 

 


Summary

Now we know how the range parameter behaves we can continue with the vbscript.


Tags


Copyright 2013 Martin Molema