Ce contenu n'est pas disponible dans la langue sélectionnée.
A.2. Comparing Entries
ldapcompare checks entries to see if the specified entry or entries contain an attribute of a specific value. For example, this checks to see if an entry has an sn value of Smith:
		
			The compare attribute can be specified in one of three ways:
		
- A single attribute:value statement passed in the command line directlysn:Smith sn:SmithCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
- A single attribute::base64value statement passed in the command line directly, for attributes likejpegPhotoor to verify certificates or CRLsjpegPhoto:dkdkPDKCDdko0eiofk== jpegPhoto:dkdkPDKCDdko0eiofk==Copy to Clipboard Copied! Toggle word wrap Toggle overflow 
- An attribute:file statement that points to a file containing a list of comparison values for the attribute, and the script iterates through the listpostalCode:/tmp/codes.txt postalCode:/tmp/codes.txtCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
			The compare operation itself has to be run against a specific entry or group of entries. A single entry DN can be passed through the command line, or a list of DNs to be compared can be given using the 
-f option.
		Example A.1. Comparing One Attribute Value to One Entry
				Both the attribute-value comparison and the DN are passed with the script.
			
ldapcompare -D "cn=Directory Manager" -W -p 389 -h server.example.com -x sn:smith uid=jsmith,ou=people,dc=example,dc=com comparing type: "sn" value: "smith" in entry "uid=jsmith,ou=people,dc=example,dc=com" compare TRUE
ldapcompare -D "cn=Directory Manager" -W -p 389 -h server.example.com -x sn:smith uid=jsmith,ou=people,dc=example,dc=com
comparing type: "sn" value: "smith" in entry "uid=jsmith,ou=people,dc=example,dc=com"
compare TRUEExample A.2. Comparing a List Attribute Values from a File
				First, create a file of possible 
sn values.
			jensen johnson johannson jackson jorgenson
jensen
johnson
johannson
jackson
jorgenson
				Then, create a list of entries to compare the values to.
			
uid=jen200,ou=people,dc=example,dc=com uid=dsj,ou=people,dc=example,dc=com uid=matthewjms,ou=people,dc=example,dc=com uid=john1234,ou=people,dc=example,dc=com uid=jack.son.1990,ou=people,dc=example,dc=com
uid=jen200,ou=people,dc=example,dc=com
uid=dsj,ou=people,dc=example,dc=com
uid=matthewjms,ou=people,dc=example,dc=com
uid=john1234,ou=people,dc=example,dc=com
uid=jack.son.1990,ou=people,dc=example,dc=com
				Then run the script.
			
ldapcompare -D "cn=Directory Manager" -W -p 389 -h server.example.com -x sn:/tmp/surnames.txt -f /tmp/names.txt
# ldapcompare -D "cn=Directory Manager" -W -p 389 -h server.example.com -x sn:/tmp/surnames.txt -f /tmp/names.txt
comparing type: "sn" value: "jensen" in entry "uid=jen200,ou=people,dc=example,dc=com"
compare TRUE