adam_xu at adagene.com.cn
2019-Apr-23 07:45 UTC
[Samba] best way to write group membership to a file
Hi sambalist, There are some questions I want to ask you. I hope that you could give some advice to me. I want to export all the groups membership to a file such as a csv for someone to audit. I know there are some command I can list group members like: list all the group: samba-tool group list and list members in some group: samba-tool group listmembers groupname so how can I merge all the output results into a file like a csv file? will a shell sript be ok or need I write a python tool or just use some windows AD manage tools? thanks. Best, yours Adam
On Tue, 23 Apr 2019 15:45:40 +0800 adam_xu--- via samba <samba at lists.samba.org> wrote:> Hi sambalist, > > There are some questions I want to ask you. I hope that you could > give some advice to me. > > I want to export all the groups membership to a file such as a csv > for someone to audit. I know there are some command I can list group > members like: list all the group: samba-tool group list > and list members in some group: > samba-tool group listmembers groupname > > so how can I merge all the output results into a file like a csv > file? will a shell sript be ok or need I write a python tool or > just use some windows AD manage tools? thanks. >You will probably have to write your own script, either around the two commands you mention or by accessing the information in AD directly with ldapsearch or ldbsearch. Rowland