Fwd: Samba4 how to list all members of a group
Lukasz Zalewski
lukas at eecs.qmul.ac.uk
Mon Apr 30 06:10:05 MDT 2012
On 30/04/12 10:20, steve wrote:
> Hi
> Sorry to forward but I had no luck with this on the samba list.
> On s4 at the cli, is it possible to get a list of members of say, Domain
> Users?
> Steve
>
Hi Steve,
For Domain Users you can try:
/usr/local/samba/bin/ldbsearch -a -H /usr/local/samba/private/sam.ldb
'(|(primaryGroupID=513)(memberOf=CN=Domain Users,CN=Users,DC=...))' dn
or using ldapsearch:
ldapsearch -h mys4dc -b 'DC=<my search base>'
'(|(primaryGroupID=513)(memberOf=CN=Domain Users,CN=Users,DC=...))' dn
Similarly for Domain Computers (using primaryGroupID=515 filter and
appropriate memberOf=CN=Domain Computers,CN=Users,DC=...).
You can probably tweak the filter a bit more to further constrain the
search.
These might be other, more elegant solutions though
HTH
L
More information about the samba-technical
mailing list