summaryrefslogtreecommitdiff
path: root/python/samba/netcmd
AgeCommit message (Collapse)AuthorFilesLines
2021-01-15samba-tool: Optionally hide disabled/expired accounts in "group listmembers"Björn Baumbach1-3/+26
--hide-expired Do not list expired group members --hide-disabled Do not list disabled group members Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Jan 15 16:34:11 UTC 2021 on sn-devel-184
2021-01-15samba-tool: Optionally hide disabled/expired accounts in "user list"Björn Baumbach1-2/+28
--hide-expired Do not list expired user accounts --hide-disabled Do not list disabled user accounts Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org>
2020-12-09samba-tool: Add a gpo command for setting smb.conf Group PolicyDavid Mulder1-2/+78
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-12-09samba-tool: Test gpo smb.conf set commandDavid Mulder1-0/+24
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-12-09samba-tool: Add a gpo command for listing smb.conf Group PoliciesDavid Mulder1-1/+42
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-12-09samba-tool: Test gpo smb.conf list commandDavid Mulder1-0/+28
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-12-09samba-tool: Add a gpo command for listing Security Group PoliciesDavid Mulder1-1/+48
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-12-09samba-tool: Test gpo Security listDavid Mulder1-0/+25
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-12-09samba-tool: Add a gpo command for setting Security Group PolicyDavid Mulder1-1/+94
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-12-09samba-tool: Test gpo Security set commandDavid Mulder1-0/+28
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-12-09samba-tool: Add a gpo command for removing Sudoers Group PolicyDavid Mulder1-1/+50
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-12-09samba-tool: Test gpo Sudoers remove commandDavid Mulder1-0/+23
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-12-09samba-tool: Add a gpo command for adding Sudoers Group PolicyDavid Mulder1-1/+56
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-12-09samba-tool: Test gpo Sudoers add commandDavid Mulder1-0/+23
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-12-09samba-tool: Add a gpo command for listing Sudoers Group PoliciesDavid Mulder1-2/+41
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-12-09samba-tool: Test gpo Sudoers list commandDavid Mulder1-0/+33
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-12-09samba-tool gpo: use common attr_defaultDouglas Bagnall1-7/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2020-12-09samba-tool drs: move attr_default to commonDouglas Bagnall2-7/+8
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2020-12-09samba-tool pso uses common timestamp functionsDouglas Bagnall1-18/+3
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2020-12-09samba-tool domain: move timestamp functions to commonDouglas Bagnall2-20/+24
Other tools use identical functions, and they too can use common.py Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2020-11-26samba-tool: Give better error information when the 'domain backup restore' ↵Andrew Bartlett1-1/+44
fails with a duplicate SID BUG: https://bugzilla.samba.org/show_bug.cgi?id=14575 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Gary Lockyer <gary@samba.org> Autobuild-Date(master): Thu Nov 26 21:15:40 UTC 2020 on sn-devel-184
2020-11-26samba-tool domain backup: Confirm the sidForRestore we will put into the ↵Andrew Bartlett1-0/+26
backup is free Otherwise the administrator might only find there is a problem once they attempt to restore the domain! BUG: https://bugzilla.samba.org/show_bug.cgi?id=14575 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2020-11-11samdb: Add samdb.domain_netbios_name()Andrew Bartlett1-8/+2
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2020-11-06Use the new CreateTrustedDomainRelax()Isaac Boukris1-44/+13
Signed-off-by: Isaac Boukris <iboukris@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-11-03samba-tool: add new "user unlock" commandBjörn Baumbach1-1/+73
Can be used to unlock a user when the badPwdCount has been reached. Introduces SamDB error classes, as suggested by Douglas Bagnall <douglas.bagnall@catalyst.net.nz> - thanks! This helps to handle expected failures. Tracebacks of really unexpected failures will not be hidden. Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-22python: Create targetdir recursivelyAndreas Schneider1-1/+1
This fixes `make test` in a release tarball. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14542 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-10-02python2 reduction: Merge remaining compat code into commonDavid Mulder6-7/+7
The remaining compat code (get_string, get_bytes, cmp) are useful helper routines which we should simply merge into common (especially since there is some duplication here). Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): David Mulder <dmulder@samba.org> Autobuild-Date(master): Fri Oct 2 14:49:36 UTC 2020 on sn-devel-184
2020-10-01samba-tool contact: rename 'contact create' to 'contact add'Jule Anger1-10/+11
Keep 'contact create' for compatibility reasons. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool group: add 'group create' as synonym for 'group add'Jule Anger1-3/+4
Add 'group create' command for a symmetric set of samba-tool subcommands Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool computer: rename 'computer create' to 'computer add'Jule Anger1-13/+14
Keep 'computer create' for compatibility reasons. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool user: rename 'user create' to 'user add'Jule Anger1-29/+15
Keep 'user create' for compatibility reasons. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool ou: rename 'ou create' to 'ou add'Jule Anger1-8/+9
Keep 'ou create' for compatibility reasons. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool contact: add new contact 'rename' commandJule Anger1-0/+178
Usage: samba-tool contact rename <contactname> [options] Rename a contact and related attributes. This command allows to set the contact's name related attributes. Use an empty attribute value to remove the specified attribute. The contactname specified on the command is the CN. Example1: samba-tool contact rename "John Doe" --surname=Bloggs \\ --force-new-cn=John Example1 shows how to change the surname ('sn' attribute) of a contact 'John Doe' to 'Bloggs' and change the CN to 'John' on the local server. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool group: add new group 'rename' commandJule Anger1-0/+155
Usage: samba-tool group rename <groupname> [options] Rename a group and related attributes. This command allows to set the group's name related attributes. Use an empty attribute value to remove the specified attribute. The groupname specified on the command is the sAMAccountName. Example1: samba-tool group rename employees --samaccountname=staff Example1 shows how to change the sAMAaccountName of a group 'employees' to 'staff' on the local server. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool user: add new user 'rename' commandBjörn Baumbach1-0/+225
Usage: samba-tool user rename <username> [options] Rename a user and related attributes. This command allows to set the user's name related attributes. The user's CN will be renamed automatically. The user's new CN will be made up by combining the given-name, initials and surname. A dot ('.') will be appended to the initials automatically. Use the --force-new-cn option to specify the new CN manually. The username specified on the command is the sAMAccountName. Example1: samba-tool user rename johndoe --surname='Bloggs' Example1 shows how to change the surname of a user 'johndoe' to 'Bloggs' on the local server. The user's CN will be renamed automatically, based on the given name, initials and surname. Pair-Programmed-With: Jule Anger <ja@sernet.de> Signed-off-by: Björn Baumbach <bb@sernet.de> Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-09-04Fixed arrow keys typo to the computer move command utilityHezekiah1-1/+1
Signed-off-by: Hezekiah <hezekiahmaina3@gmail.com> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): Alexander Bokovoy <ab@samba.org> Autobuild-Date(master): Fri Sep 4 16:57:30 UTC 2020 on sn-devel-184
2020-09-02samba-tool: Create unix user with modified template homedirDavid Mulder1-2/+3
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-08-19s3:client: Turn off smb signing for message opAndreas Schneider2-2/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-19python: Set smb signing via the creds APIAndreas Schneider2-1/+15
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-19python: Remove unused sign argument from smb_connection()Andreas Schneider1-5/+4
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-11python compat: remove text_typeDouglas Bagnall2-5/+3
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2020-08-11python compat: remove binary_typeDouglas Bagnall1-2/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2020-07-17python: wrap 'import dckeytab' in an explanatory functionDouglas Bagnall1-1/+2
The samba.dckeytab module has magic effects on samba.net, but never appears to be used. That can be confusing, both to people and to linters. Here we wrap that confusion up into a well-commented function, so we never again have to wonder why the unused import is there. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Mulder <dmulder@samba.org>
2020-07-17samba-tool ntacl: remove unused imports and variablesDouglas Bagnall1-1/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Mulder <dmulder@samba.org>
2020-06-23samba-tool: add command for installing gpo samba admxDavid Mulder1-0/+72
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-06-11samba-tool dns query --help: Someone forgot 'PTR' from the list of record typesRowland Penny1-1/+2
Signed-off-by: Rowland Penny <rpenny@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jun 11 04:37:37 UTC 2020 on sn-devel-184
2020-04-29samba-tool: fetch "no such subcommand" error and print error messageBjörn Baumbach1-0/+3
This patch especially improves the case where extra arguments are used. Without this patch just the attributes are mentioned as invalid, if samba-tool is called with an invalid/unknown subcommand. Example without this patch: # samba-tool sites list --all Usage: samba-tool sites <subcommand> samba-tool sites: error: no such option: --all This can be deceptive for users. Is looks like the "list" command does not provide a "--all" option. Example with this patch: # samba-tool sites list --all samba-tool sites: no such subcommand: list Usage: samba-tool sites <subcommand> (...) Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Apr 29 08:08:21 UTC 2020 on sn-devel-184
2020-04-02samba-tool group show: only shows global security groups, this patch makes ↵Rowland Penny1-3/+2
it show all groups. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14335 Signed-off-by: Rowland Penny <rpenny@samba.org> Reviewed-by: Björn Baumbach <bb@samba.org> Autobuild-User(master): Björn Baumbach <bb@sernet.de> Autobuild-Date(master): Thu Apr 2 15:27:53 UTC 2020 on sn-devel-184
2020-03-27python/netcmd/dns: improve exception handling in cmd_add_record()Stefan Metzmacher1-1/+3
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2020-03-27python/netcmd/dns: improve exception handling in cmd_delete_record()Stefan Metzmacher1-1/+3
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>