Data.Get.LD.Find
Top  Previous  Next


Searches Linux Directory and fills the [Data] section with any combination of properties for matching objects

A connection must be established with Lin.DS.Logon before Data.Get.LD.Find can be used.

Category
Data section

Script section
All

Data.Get.LD.Find Container, SearchFilter, IncludeSubContainers, ListOfProperties [,Add]

Container
Full directory path to container to search  

SearchFilter
LDAP search filter as defined in RFC 2254  
 
Examples  
SearchFilter
Description
(cn=*)
All objects.
(objectClass=posixAccount)
All user objects.
(objectClass=posixGroup)
All group objects.
(&(objectClass=posixAccount)(cn=steve))
The user object "steve".
(&(objectClass=posixAccount)(!(cn=steve)))
All user objects except "steve".
(&(objectClass=posixAccount)(givenName=eve*))
All user objects where first name starts with "eve".
(&(objectClass=posixAccount)(sn=*son*))
All user objects where last name contains "son".
(&(objectClass=posixAccount)(|(sn=s*)(sn=b*)))
All user objects where last name starts with "s" or "b".
(&(objectClass=posixAccount)(mail=*))
All users with a mail attribute.
(&(objectClass=posixAccount)(!(sambaSID=*)))
All users without a sambaSID attribute.
 
 
Notice: The search filter parenthesis cannot be omitted.  

IncludeSubContainers
Options: Yes | No  
·Yes - objects in subcontainers should be included in search  
·No - objects in subcontainers should not be included in search  

ListOfProperties
List of properties and destination columns, Format: LDpropertyName§Column§[LDpropertyName§Column§].  
 
For a list of common properties, see tables for Lin.DS.Op.SetProperty  
 
The easiest way to find out correct property names for accounts is probably to use SetupExplorer, see How to display all existing properties for one account  
 
"Data.Get.LD.Find" also returns one none-standard LD property -  
·LDpath = full LD path to object (use with LD commands such as Lin.DS.Op.Init)  

Add [Optional parameter]
Options: Add |  
·Add - Add data at the end of the [Data] section instead of replacing the entire [Data] section. This is useful when more than one Data.Get.LD.Find command is used to get data from more than one container.  

Examples

1) Search "dc=com/dc=domain", OU "People" and subcontainers for users with gidNumber 602. Put LDpath of matching objects in [Data] column 1.

[Init_Batch_Begin] 
Data.Get.LD.Find dc=com/dc=domain/ou=people, (&(objectClass=posixAccount)(gidNumber=602)), yes, ldpath§1§
[Init_Batch_End]


2) Search "dc=com/dc=domain" and subcontainers for users where email address ends with "@acme.com". Put LDpath of matching objects in [Data] column 1 and email address in column 2.

[Init_Batch_Begin]
Data.Get.LD.Find dc=com/dc=domain, (&(objectClass=posixAccount)(mail=*@acme.com)), yes, ldpath§1§mail§2§
[Init_Batch_End]

3) Search "dc=com/dc=domain" and subcontainers for users where sambaLogonScript is "MyScript.cmd". Put LDpath of matching objects in [Data] column 1.

[Init_Batch_Begin]
Data.Get.LD.Find dc=com/dc=domain, (&(objectClass=posixAccount)(sambaLogonScript=MyScript.cmd)), yes, ldpath§1§
[Init_Batch_End]