Re: [Samba] python scripting samba

2013-04-16 Thread Mike Ray
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 geo...@trinity.unimelb.edu.au 
To: samba samba@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 

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


[Samba] python scripting samba

2013-04-15 Thread Geoff Crompton
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


Re: [Samba] python scripting samba

2013-04-15 Thread Gémes Géza

2013-04-16 01:30 keltezéssel, Geoff Crompton írta:
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

Have a look at the samba-tool code at:
/usr/local/samba/lib/python2.7/site-packages/samba/netcmd/
and
/usr/local/samba/lib/python2.7/site-packages/samba/provision/
There are really good examples of using SAMDb even remote ones.

Regards

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