Thanks for your help. The dn begins with the form cn=lastname, firstname, ou=... I had the dn in double quotes. When I put the dn in single quotes and escaped the comma after the lastname then the search worked.