[Samba] python scripting samba

Mike Ray mray at xes-inc.com
Tue Apr 16 08:08:15 MDT 2013


Check out the python command "call" -- it allows you to run a command as if you were at a shell prompt. Using this and the ldb tools to modify the SAM database included with Samba4 you can create pretty much script any conceivable action for users/groups. 

I'd personally recommend using ldbmodify with an ldif file over any of the other ldbtool, this will be the easiest to script. For some basics on ldif files, check out http://www.zytrax.com/books/ldap/ch8/ 

Also don't forget about MS AD tools -- they might not lend themselves to scripting but they give a very nice front for management. 

Good luck, 
Mike Ray 

----- Original Message -----

From: "Geoff Crompton" <geoffc at trinity.unimelb.edu.au> 
To: "samba" <samba at lists.samba.org> 
Sent: Monday, April 15, 2013 6:30:37 PM 
Subject: [Samba] python scripting samba 

Can someone point me to some documentation on scripting samba user and 
group management from python? I'd much rather not do this via calls out 
to samba-tool, and if I could do this remotely (via LDAP like calls) I'd 
be even happier. 

Cheers, 
Geoff 
-- 
To unsubscribe from this list go to the following URL and read the 
instructions: https://lists.samba.org/mailman/options/samba 



More information about the samba mailing list