[Samba] Script to reset group memberships...

Marco Gaiarin gaio at sv.lnf.it
Wed Oct 4 13:45:07 UTC 2017


I was used, for users that leave my network, to disable the account but
also ''sanitize'' the memberships, eg reset group membership to a
default values (normally, 'domain users').

Clearly, using smbldap-tools in a NT domain was easy.


How can achieve the same result in a samba AD domain? Seems that
avaliable commands/tools (pdbedit, wbinfo, samba-tool) does not have
this feature.


I'v think about enumerating the user's group, eg:

	id gaio | cut -d '=' -f 4 | tr -s ',' '\n' | cut -d '(' -f 2 | tr -d ')' | grep ^LNFFVG | cut -d '\' -f 2

and then remove 'all but the default group', but i'm seeking feedback.


Thanks.

-- 
dott. Marco Gaiarin				        GNUPG Key ID: 240A3D66
  Associazione ``La Nostra Famiglia''          http://www.lanostrafamiglia.it/
  Polo FVG   -   Via della Bontà, 7 - 33078   -   San Vito al Tagliamento (PN)
  marco.gaiarin(at)lanostrafamiglia.it   t +39-0434-842711   f +39-0434-842797

		Dona il 5 PER MILLE a LA NOSTRA FAMIGLIA!
      http://www.lanostrafamiglia.it/index.php/it/sostienici/5x1000
	(cf 00307430132, categoria ONLUS oppure RICERCA SANITARIA)



More information about the samba mailing list