Samba-tool-external: Difference between revisions

From SambaWiki
mNo edit summary
mNo edit summary
Line 175: Line 175:
<td rowspan="2">Sets password settings</td>
<td rowspan="2">Sets password settings</td>
<td>set</td>
<td>set</td>
<td>-H<br>--quiet<br>--complexity=on|off|default<br>--store-plaintext=on|off|default<br>--history-length=<br>--min-pwd-length=<br>--min-pwd-age=<br>--max-pwd-age=</td>
<td rowspan="2"></td>
<td rowspan="2"></td>
<td rowspan="2"></td>
</tr>
</tr>
<tr>
<tr>
<td>show</td>
<td>show</td>
<td></td>
</tr>
</tr>
<tr>
<tr>
<td>password</td>
<td rowspan="2">password</td>
<td>set or change password, </td>
<td rowspan="2">set or change password, </td>
<td>set, change</td>
<td>set <username> <password></td>
<td>user</td>
<td></td>
<td rowspan="2"></td>
</tr>
<tr>
<td>change</td>
<td></td>
<td></td>
</tr>
</tr>
Line 191: Line 196:
<td>setexpiry</td>
<td>setexpiry</td>
<td>Sets the expiration of a user account</td>
<td>Sets the expiration of a user account</td>
<td></td>
<td><username></td>
<td>[username]</td>
<td>-H<br>--filter<br>--days=<br>--noexpiry</td>
<td></td>
<td></td>
</tr>
</tr>
Line 198: Line 203:
<td>setpassword</td>
<td>setpassword</td>
<td>set user password locally, need write access to ldb files</td>
<td>set user password locally, need write access to ldb files</td>
<td></td>
<td><username?></td>
<td>-H<br>--filter<br>--newpassword<br>--must-change-at-next-login</td>
<td></td>
<td></td>
<td></td>
</tr>
</tr>
Line 205: Line 210:
<td>time</td>
<td>time</td>
<td>Retrieve the time on a remote server (server connection needed)</td>
<td>Retrieve the time on a remote server (server connection needed)</td>
<td><servername?></td>
<td></td>
<td></td>
<td>[server-name]</td>
<td>net time <servername></td>
</tr>
<tr>
<td rowspan="2">user</td>
<td rowspan="2">create or delete a user</td>
<td>add <username> <password?></td>
<td></td>
<td></td>
<td rowspan="2"></td>
</tr>
</tr>
<tr>
<tr>
<td>user</td>
<td>delete <username></td>
<td>create or delete a user</td>
<td></td>
<td>create, delete</td>
<td></td>
<td></td>
</tr>
</tr>
Line 219: Line 228:
<td>vampire</td>
<td>vampire</td>
<td>Join and synchronise a remote AD domain to the local server<br>(server connection needed)</td>
<td>Join and synchronise a remote AD domain to the local server<br>(server connection needed)</td>
<td></td>
<td>domain</td>
<td>domain</td>
<td></td>
<td></td>
<td></td>
</tr>
</tr>

Revision as of 19:53, 2 May 2011

This wiki page will document the current externals of the samba-tool command with proposed changes to be made for consistency and usability.

General options are options that can be used on all commands and are as follows:

  • Samba Options
    • list samba options here
  • Version Options
    • -V
    • --version
  • Credential Options
    • list cred options

Open for discussion is the formats of some of the global options. Improvements to usability will be considered and implemented on option by option basis as community approves.

Current commands listed in __init__.py in samba 4 Version 4.0.0alpha15-GIT-b12fbc2

samba-tool current commands:

Subcommand Description Parameters Command specific options Net command
acl get or set acls on a file nt get <file> --as-sddl
--xattr\-backend=native|tdb
--eadb-file=<file>
nt set <file> --quiet=
--xattr-backend=native|tdb
--eadb-file=<file>
ds set <file> --host=
--car=...
--action=allow|deny
--objectdn=
--trusteedn=
--sddl=
--eadb-file=<file>
domainlevel Raises domain and forest function level show -H
--quiet
--forest=2003|2008|2008_R2
--domain=2003|2008|2008_R2
raise
drs various directory replication services bind <dc>
kcc <dc>
replicate <dest_dc> <source_dc> <nc> --add-ref
--sync-force
showrepl <dc>
enableaccount enable a user <username> --filter=
export Dumps kerberos keys of the domain into a keytab keytab <keytab> net export keytab <keytab>
fsmo Makes the target DC transfer or seize fsmo role (server connection needed) show --url
--force
--role=rid|pdc|infrastructure|scehma|naming|all
transfer --url
--force
--role=rid|pdc|infrastructure|scehma|naming|all
seize --url
--force
--role=rid|pdc|infrastructure|scehma|naming|all
group Add or delete groups or add members to or remove members from a group add <groupname> -H
--groupou=
--group-type=Security|Distribution
--description=
--mail-address=
--notest=
delete <groupname> -H
addmembers <groupname> <listofmembers> -H
removemembers <groupname> <listofmembers> -H
gpo2 List group policies list <username> -H
listall
join Join a domain as either a member or a backup domain controller
(server connection required)
<dnsdomain> DC --server=
--site=
<dnsdomain> RODC
<dnsdomain> MEMBER
ldapcmp compare two ldap databases <url1> <url2> <context1?> <context2?> <context3?> --two
--quiet
--verbose
--sd
--sort-aces
--view
--base
--base2
--scope
machinepw get machine PW out of SAM <accountname> net machinepw <accountname>
newuser Create a new user <username> <password?> -H
--must-change-at_next-login
--user-username-as-cn<br.--userou
--surname
--given-name
--initials
--profile-path
--script-path
--home-drive
--home-directory
--job-title
--department
--company
--description
--mail-address
--internet-address
--telephone-number
--physical-delivery-office
pwsettings Sets password settings set -H
--quiet
--complexity=on|off|default
--store-plaintext=on|off|default
--history-length=
--min-pwd-length=
--min-pwd-age=
--max-pwd-age=
show
password set or change password, set <username> <password>
change
setexpiry Sets the expiration of a user account <username> -H
--filter
--days=
--noexpiry
setpassword set user password locally, need write access to ldb files <username?> -H
--filter
--newpassword
--must-change-at-next-login
time Retrieve the time on a remote server (server connection needed) <servername?> net time <servername>
user create or delete a user add <username> <password?>
delete <username>
vampire Join and synchronise a remote AD domain to the local server
(server connection needed)
domain

samba-tool proposal for command syntax changes

The proposed format for all new / existing functions on the samba-tool command are as follows:

Command syntax will follow the format samba-tool <object> <action> parameter(s) <command specific options> <global options> unless otherwise indicated.

samba-tool <object> <action> <command specific options> <general options>

  • When the samba-tool command is issued without a subcommand, it will return a list of valid subcommands (it does this today)
  • After each subcommand is entered, if more parameters are required a list of what comes next will be shown (sometimes does this today)
  • If the command syntax is completely incorrect, will give the format of the subcommand (sometimes does this today)
  • For each subcommand, help will be provided
  • Error handling will be improved, more errors will be caught with useable messages being issued where applicable
Object Action Parameters Specific Options Global Options Comments and Equivalent net command (samba 3)
acl get nt <file> --as-sddl
--xattr-backend=native|tdb
--eadb-file=file
global options Could combine get and nt into one action getnt
Of leave as get <space> nt for historical purposes
set nt <file> --xattr-backend=native|tdb
--eadb-file=file
global options Could combine set and nt into one action setnt
set ds <file> --objectdn=objectdn
--car=control right
--action=deny|allow
--trusteedn=trustee-dn
global options Could combine set and ds into one action setds
domainlevel show global options
raise -H
--quiet
--forest
--domain
global options
drs bind
kcc
replicate
showrepl
options
group add
delete
addmembers
removemembers
gpo2 list
listall
join dns domain add options global options What is the object being joined? server? machine?
fsmo show add options global options What is the object being shown?
domain controller? server? machine?
fsmo transfer add options global options What is the object?
fsmo seize add options global options What is the object?
export keytab add options global options What is the object?
ldap compare URL1, URL2 add options Change to split into ldap compare.
pwsettings show
set add parameters that can be set
password set user
change user
time server-name Change format? add an optional action: show ?
user create username global options Changing add to create, can / should make an alias?
The help on this command already says add - create a new user
create makes more sense, add sounds like it already exists and adding it to a group, for instance
opposite of removemembers is addmembers
delete username global options
setexpiry username -H help global options this used to be setexpiry username command
--days=int
--filter=str
--noexpiry
enableaccount username -H help global options this used to be enableaccount username command
--filter=str
vampire domain global options Keep as vampire command for usability / historical purposes
Do not change to object action format