From owner-freebsd-questions@FreeBSD.ORG Mon Jan 19 04:32:54 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3396C1065670 for ; Mon, 19 Jan 2009 04:32:54 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email1.allantgroup.com (email1.emsphone.com [199.67.51.115]) by mx1.freebsd.org (Postfix) with ESMTP id DFD498FC16 for ; Mon, 19 Jan 2009 04:32:53 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan-a.emsphone.com [199.67.51.107]) by email1.allantgroup.com (8.14.0/8.14.0) with ESMTP id n0J4Wq9F037663 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 18 Jan 2009 22:32:52 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.3/8.14.3) with ESMTP id n0J4WqdY072284 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 18 Jan 2009 22:32:52 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.3/8.14.3/Submit) id n0J4WpF9072278; Sun, 18 Jan 2009 22:32:51 -0600 (CST) (envelope-from dan) Date: Sun, 18 Jan 2009 22:32:50 -0600 From: Dan Nelson To: Jay Hall Message-ID: <20090119043250.GB45931@dan.emsphone.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 7.1-STABLE User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: ClamAV version 0.94.1, clamav-milter version 0.94.1 on email1.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (email1.allantgroup.com [199.67.51.78]); Sun, 18 Jan 2009 22:32:52 -0600 (CST) X-Scanned-By: MIMEDefang 2.45 Cc: freebsd-questions@freebsd.org Subject: Re: ldapsearch question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 04:32:54 -0000 In the last episode (Jan 18), Jay Hall said: > I am running the following against an Active Directory server. > > ldapsearch -D "cn=admin_user,cn=users,dc=xx,dc=com" -x -w "password" - > h 10.129.10.42 -p 3268 -b 'dc=abc,dc=com' -s sub > '(!(objectclass=computer))' '(!(mail=*))' dn mail > > I am trying to return only objects for which the mail attribute is > defined. I think my search is incorrect, and I am searching for the > mail attribute being null. Your search filter is currently (!(objectclass=computer)) , and you are asking for the attributes (!(mail=*)), dn, and mail to be returned. I think you want this: '(&(!(objectclass=computer))(mail=*))' i.e. (objectclass isn't computer) AND (mail attribute is present). http://tools.ietf.org/html/rfc2254 -- Dan Nelson dnelson@allantgroup.com