[Samba] ldap search with DN which contains space

Felipe_G0NZÁLEZ_SANTIAG0 fgonzalez at uci.cu
Sun Nov 6 03:37:53 UTC 2016

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? 

Felipe_ González_Santiago 
La_Habana. CUBA 

"Remind yourself that you cannot fail at being yourself" 
Wayne Dyer 

More information about the samba mailing list