[Samba] ldap search with DN which contains space
Rowland Penny
rpenny at samba.org
Sun Nov 6 09:11:38 UTC 2016
On Sun, 6 Nov 2016 09:55:16 +0100
Marc Muehlfeld via samba <samba at lists.samba.org> wrote:
> Hi Felipe Gonzalez,
>
> Am 06.11.2016 um 04:37 schrieb Felipe_G0NZĂLEZ_SANTIAG0 via samba:
> > Hello, I am trying to get all the members of a given group.
> > I run this command:
> > #ldbsearch -H /var/lib/samba/private/sam.ldb
> > memberOf=CN=Administrators,CN=Builtin,DC=ejemplo,DC=cu And it works
> > fine.
> >
> > BUT: problems arise when the group name contains spaces, e.g
> > 'Domain Controllers' Then, I run:
> > #ldbsearch -H /var/lib/samba/private/sam.ldb memberOf=CN=Domain
> > Controllers,CN=Users,DC=ejemplo,DC=cu And this return no records.
> > Even using 'DN' or "DN" the < no records> behaviour persists.
> >
> > So, How can I get the members of a group which contains spaces in
> > its name by using ldbsearch? Or other alternative?
>
>
> Put the filter in single quotes, if it contains spaces. For example:
> # ldbsearch -H /usr/local/samba/private/sam.ldb 'memberOf=CN=Domain
> Admins,CN=Users,DC=samdom,DC=example,DC=com'
>
>
> Regards,
> Marc
>
Or you can escape the space:
ldbsearch -H /usr/local/samba/private/sam.ldb memberOf=CN=Domain\
Admins,CN=Users,DC=samdom,DC=example,DC=com
Rowland
More information about the samba
mailing list