[Samba] scripting user adds/deletes

David Bear dwbear75 at gmail.com
Wed Jul 23 15:38:43 MDT 2014


But we do need to script it because our source for users in our system
comes from another data base. Any new users, or change of status for
existing users is pulled from a data base. We don't want to have to rekey
something that should be automated.

I could use python to call the samba-tool script -- a python script. This
would require a call to os.popen or some other call that would make a
shell, call samba-tool with args, and then return.

I was hoping that I could import some function directly in to my python
script and call it that way. Is there a python api doc or something that I
could use as a reference?



On Wed, Jul 23, 2014 at 12:21 AM, Quentin Gibeaux <qgibeaux at iris-tech.fr>
wrote:

> On 23/07/2014 08:17, David Bear wrote:
>
>> I'm wanting to build a script that will add and remove or deactivate
>> users.
>> My language is python. are there are docs that describe how to use some of
>> the python modules to do this?
>>
>>  No need to build a script :
>
> root at server:~# samba-tool user
> Usage: samba-tool user <subcommand>
>
> User management.
>
>
> Options:
>   -h, --help  show this help message and exit
>
>
> Available subcommands:
>   add          - Create a new user.
>   create       - Create a new user.
>   delete       - Delete a user.
>   disable      - Disable an user.
>   enable       - Enable an user.
>   list         - List all users.
>   password     - Change password for a user account (the one provided in
> authentication).
>   setexpiry    - Set the expiration of a user account.
>   setpassword  - Set or reset the password of a user account.
> For more help on a specific subcommand, please type: samba-tool user
> <subcommand> (-h|--help)
> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba
>



-- 
David Bear
mobile: (602) 903-6476


More information about the samba mailing list