1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="samba-tool.8">
6 <refentrytitle>samba-tool</refentrytitle>
7 <manvolnum>8</manvolnum>
8 <refmiscinfo class="source">Samba</refmiscinfo>
9 <refmiscinfo class="manual">System Administration tools</refmiscinfo>
10 <refmiscinfo class="version">&doc.version;</refmiscinfo>
15 <refname>samba-tool</refname>
16 <refpurpose>Main Samba administration tool.
22 <command>samba-tool</command>
23 <arg choice="opt">-h</arg>
24 <arg choice="opt">-W myworkgroup</arg>
25 <arg choice="opt">-U user</arg>
26 <arg choice="opt">-d debuglevel</arg>
27 <arg choice="opt">--v</arg>
32 <title>DESCRIPTION</title>
33 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
34 <manvolnum>7</manvolnum></citerefentry> suite.</para>
38 <title>OPTIONS</title>
43 <term>-h|--help</term>
45 Show this help message and exit
50 <term>--realm=REALM</term>
57 <term>--simple-bind-dn=DN</term>
59 DN to use for a simple bind
64 <term>--password=PASSWORD</term>
71 <term>-U USERNAME|--username=USERNAME</term>
78 <term>-W WORKGROUP|--workgroup=WORKGROUP</term>
85 <term>-N|--no-pass</term>
87 Don't ask for a password
92 <term>-k KERBEROS|--kerberos=KERBEROS</term>
99 <term>--ipaddress=IPADDRESS</term>
101 IP address of the server
105 &popt.common.samba.client;
111 <title>COMMANDS</title>
114 <title>computer create <replaceable>computername</replaceable> [options]</title>
115 <para>Create a new computer in the Active Directory Domain.</para>
116 <para>The new computer name specified on the command is the
117 sAMAccountName, with or without the trailing dollar sign.</para>
121 <term>--computerou=COMPUTEROU</term>
123 DN of alternative location (with or without domainDN counterpart) to
124 default CN=Computers in which new computer object will be created.
130 <term>--description=DESCRIPTION</term>
132 The new computers's description.
137 <term>--ip-address=IP_ADDRESS_LIST</term>
139 IPv4 address for the computer's A record, or IPv6 address for AAAA record,
140 can be provided multiple times.
145 <term>--service-principal-name=SERVICE_PRINCIPAL_NAME_LIST</term>
147 Computer's Service Principal Name, can be provided multiple times.
152 <term>--prepare-oldjoin</term>
154 Prepare enabled machine account for oldjoin mechanism.
161 <title>computer delete <replaceable>computername</replaceable> [options]</title>
162 <para>Delete an existing computer account.</para>
163 <para>The computer name specified on the command is the
164 sAMAccountName, with or without the trailing dollar sign.</para>
168 <title>computer list</title>
169 <para>List all computers.</para>
173 <title>computer move <replaceable>computername</replaceable> <replaceable>new_parent_dn</replaceable> [options]</title>
174 <para>This command moves a computer account into the specified
175 organizational unit or container.</para>
176 <para>The computername specified on the command is the
177 sAMAccountName, with or without the trailing dollar sign.</para>
178 <para>The name of the organizational unit or container can be
179 specified as a full DN or without the domainDN component.</para>
183 <title>computer show <replaceable>computername</replaceable> [options]</title>
184 <para>Display a computer AD object.</para>
185 <para>The computer name specified on the command is the
186 sAMAccountName, with or without the trailing dollar sign.</para>
190 <term>--attributes=USER_ATTRS</term>
192 Comma separated list of attributes, which will be printed.
199 <title>dbcheck</title>
200 <para>Check the local AD database for errors.</para>
204 <title>delegation</title>
205 <para>Manage Delegations.</para>
209 <title>delegation add-service <replaceable>accountname</replaceable> <replaceable>principal</replaceable> [options]</title>
210 <para>Add a service principal as msDS-AllowedToDelegateTo.</para>
214 <title>delegation del-service <replaceable>accountname</replaceable> <replaceable>principal</replaceable> [options]</title>
215 <para>Delete a service principal as msDS-AllowedToDelegateTo.</para>
219 <title>delegation for-any-protocol <replaceable>accountname</replaceable> [(on|off)] [options]</title>
220 <para>Set/unset UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION (S4U2Proxy)
221 for an account.</para>
225 <title>delegation for-any-service <replaceable>accountname</replaceable> [(on|off)] [options]</title>
226 <para>Set/unset UF_TRUSTED_FOR_DELEGATION for an account.</para>
230 <title>delegation show <replaceable>accountname</replaceable> [options] </title>
231 <para>Show the delegation setting of an account.</para>
236 <para>Manage Domain Name Service (DNS).</para>
240 <title>dns add <replaceable>server</replaceable> <replaceable>zone</replaceable> <replaceable>name</replaceable> <replaceable>A|AAAA|PTR|CNAME|NS|MX|SRV|TXT</replaceable> <replaceable>data</replaceable></title>
241 <para>Add a DNS record.</para>
245 <title>dns delete <replaceable>server</replaceable> <replaceable>zone</replaceable> <replaceable>name</replaceable> <replaceable>A|AAAA|PTR|CNAME|NS|MX|SRV|TXT</replaceable> <replaceable>data</replaceable></title>
246 <para>Delete a DNS record.</para>
250 <title>dns query <replaceable>server</replaceable> <replaceable>zone</replaceable> <replaceable>name</replaceable> <replaceable>A|AAAA|PTR|CNAME|NS|MX|SRV|TXT|ALL</replaceable> [options] <replaceable>data</replaceable></title>
251 <para>Query a name.</para>
255 <title>dns roothints <replaceable>server</replaceable> [<replaceable>name</replaceable>] [options]</title>
256 <para>Query root hints.</para>
260 <title>dns serverinfo <replaceable>server</replaceable> [options]</title>
261 <para>Query server information.</para>
265 <title>dns update <replaceable>server</replaceable> <replaceable>zone</replaceable> <replaceable>name</replaceable> <replaceable>A|AAAA|PTR|CNAME|NS|MX|SRV|TXT</replaceable> <replaceable>olddata</replaceable> <replaceable>newdata</replaceable></title>
266 <para>Update a DNS record.</para>
270 <title>dns zonecreate <replaceable>server</replaceable> <replaceable>zone</replaceable> [options]</title>
271 <para>Create a zone.</para>
275 <title>dns zonedelete <replaceable>server</replaceable> <replaceable>zone</replaceable> [options]</title>
276 <para>Delete a zone.</para>
280 <title>dns zoneinfo <replaceable>server</replaceable> <replaceable>zone</replaceable> [options]</title>
281 <para>Query zone information.</para>
285 <title>dns zonelist <replaceable>server</replaceable> [options]</title>
286 <para>List zones.</para>
290 <title>domain</title>
291 <para>Manage Domain.</para>
295 <title>domain classicupgrade [options] <replaceable>classic_smb_conf</replaceable></title>
296 <para>Upgrade from Samba classic (NT4-like) database to Samba AD DC
301 <title>domain dcpromo <replaceable>dnsdomain</replaceable> [DC|RODC] [options]</title>
302 <para>Promote an existing domain member or NT4 PDC to an AD DC.</para>
306 <title>domain demote</title>
307 <para>Demote ourselves from the role of domain controller.</para>
311 <title>domain exportkeytab <replaceable>keytab</replaceable> [options]</title>
312 <para>Dumps Kerberos keys of the domain into a keytab.</para>
316 <title>domain info <replaceable>ip_address</replaceable> [options]</title>
317 <para>Print basic info about a domain and the specified DC.
322 <title>domain join <replaceable>dnsdomain</replaceable> [DC|RODC|MEMBER|SUBDOMAIN] [options]</title>
323 <para>Join a domain as either member or backup domain controller.</para>
327 <title>domain level <replaceable>show|raise</replaceable> <replaceable>options</replaceable> [options]</title>
328 <para>Show/raise domain and forest function levels.</para>
332 <title>domain passwordsettings <replaceable>show|set</replaceable> <replaceable>options</replaceable> [options]</title>
333 <para>Show/set password settings.</para>
337 <title>domain provision</title>
338 <para>Promote an existing domain member or NT4 PDC to an AD DC.</para>
342 <title>domain trust</title>
343 <para>Domain and forest trust management.</para>
347 <title>domain trust create <replaceable>DOMAIN</replaceable> <replaceable>options</replaceable> [options]</title>
348 <para>Create a domain or forest trust.</para>
352 <title>domain trust delete <replaceable>DOMAIN</replaceable> <replaceable>options</replaceable> [options]</title>
353 <para>Delete a domain trust.</para>
357 <title>domain trust list <replaceable>options</replaceable> [options]</title>
358 <para>List domain trusts.</para>
362 <title>domain trust namespaces [<replaceable>DOMAIN</replaceable>] <replaceable>options</replaceable> [options]</title>
363 <para>Manage forest trust namespaces.</para>
367 <title>domain trust show <replaceable>DOMAIN</replaceable> <replaceable>options</replaceable> [options]</title>
368 <para>Show trusted domain details.</para>
372 <title>domain trust validate <replaceable>DOMAIN</replaceable> <replaceable>options</replaceable> [options]</title>
373 <para>Validate a domain trust.</para>
378 <para>Manage Directory Replication Services (DRS).</para>
382 <title>drs bind</title>
383 <para>Show DRS capabilities of a server.</para>
387 <title>drs kcc</title>
388 <para>Trigger knowledge consistency center run.</para>
392 <title>drs options</title>
393 <para>Query or change <replaceable>options</replaceable> for NTDS Settings
394 object of a domain controller.</para>
398 <title>drs replicate <replaceable>destination_DC</replaceable> <replaceable>source_DC</replaceable> <replaceable>NC</replaceable> [options]</title>
399 <para>Replicate a naming context between two DCs.</para>
403 <title>drs showrepl</title>
404 <para>Show replication status.</para>
409 <para>Administer DS ACLs</para>
413 <title>dsacl set</title>
414 <para>Modify access list on a directory object.</para>
419 <para>Manage Flexible Single Master Operations (FSMO).</para>
423 <title>fsmo seize [options]</title>
424 <para>Seize the role.</para>
428 <title>fsmo show</title>
429 <para>Show the roles.</para>
433 <title>fsmo transfer [options]</title>
434 <para>Transfer the role.</para>
439 <para>Manage Group Policy Objects (GPO).</para>
443 <title>gpo create <replaceable>displayname</replaceable> [options]</title>
444 <para>Create an empty GPO.</para>
448 <title>gpo del <replaceable>gpo</replaceable> [options]</title>
449 <para>Delete GPO.</para>
453 <title>gpo dellink <replaceable>container_dn</replaceable> <replaceable>gpo</replaceable> [options]</title>
454 <para>Delete GPO link from a container.</para>
458 <title>gpo fetch <replaceable>gpo</replaceable> [options]</title>
459 <para>Download a GPO.</para>
463 <title>gpo getinheritance <replaceable>container_dn</replaceable> [options]</title>
464 <para>Get inheritance flag for a container.</para>
468 <title>gpo getlink <replaceable>container_dn</replaceable> [options]</title>
469 <para>List GPO Links for a container.</para>
473 <title>gpo list <replaceable>username</replaceable> [options]</title>
474 <para>List GPOs for an account.</para>
478 <title>gpo listall</title>
479 <para>List all GPOs.</para>
483 <title>gpo listcontainers <replaceable>gpo</replaceable> [options]</title>
484 <para>List all linked containers for a GPO.</para>
488 <title>gpo setinheritance <replaceable>container_dn</replaceable> <replaceable>block|inherit</replaceable> [options]</title>
489 <para>Set inheritance flag on a container.</para>
493 <title>gpo setlink <replaceable>container_dn</replaceable> <replaceable>gpo</replaceable> [options]</title>
494 <para>Add or Update a GPO link to a container.</para>
498 <title>gpo show <replaceable>gpo</replaceable> [options]</title>
499 <para>Show information for a GPO.</para>
504 <para>Manage groups.</para>
508 <title>group add <replaceable>groupname</replaceable> [options]</title>
509 <para>Create a new AD group.</para>
513 <title>group addmembers <replaceable>groupname</replaceable> <replaceable>members</replaceable> [options]</title>
514 <para>Add members to an AD group.</para>
518 <title>group delete <replaceable>groupname</replaceable> [options]</title>
519 <para>Delete an AD group.</para>
523 <title>group list</title>
524 <para>List all groups.</para>
528 <title>group listmembers <replaceable>groupname</replaceable> [options]</title>
529 <para>List all members of the specified AD group.</para>
533 <title>group move <replaceable>groupname</replaceable> <replaceable>new_parent_dn</replaceable> [options]</title>
534 <para>This command moves a group into the specified organizational unit
536 <para>The groupname specified on the command is the sAMAccountName.
538 <para>The name of the organizational unit or container can be
539 specified as a full DN or without the domainDN component.</para>
544 <title>group removemembers <replaceable>groupname</replaceable> <replaceable>members</replaceable> [options]</title>
545 <para>Remove members from the specified AD group.</para>
549 <title>ldapcmp <replaceable>URL1</replaceable> <replaceable>URL2</replaceable> <replaceable>domain|configuration|schema|dnsdomain|dnsforest</replaceable> [options] </title>
550 <para>Compare two LDAP databases.</para>
555 <para>Manage NT ACLs.</para>
559 <title>ntacl get <replaceable>file</replaceable> [options]</title>
560 <para>Get ACLs on a file.</para>
564 <title>ntacl set <replaceable>acl</replaceable> <replaceable>file</replaceable> [options]</title>
565 <para>Set ACLs on a file.</para>
569 <title>ntacl sysvolcheck</title>
570 <para>Check sysvol ACLs match defaults (including correct ACLs on GPOs).</para>
574 <title>ntacl sysvolreset</title>
575 <para>Reset sysvol ACLs to defaults (including correct ACLs on GPOs).</para>
579 <title>ou create <replaceable>ou_dn</replaceable> [options]</title>
580 <para>Create an organizational unit.</para>
581 <para>The name of the organizational unit can be specified as a full DN
582 or without the domainDN component.</para>
586 <term>--description=DESCRIPTION</term>
588 Specify OU's description.
595 <title>ou delete <replaceable>ou_dn</replaceable> [options]</title>
596 <para>Delete an organizational unit.</para>
597 <para>The name of the organizational unit can be specified as a full DN
598 or without the domainDN component.</para>
602 <term>--force-subtree-delete</term>
604 Delete organizational unit and all children reclusively.
611 <title>ou list [options]</title>
612 <para>List all organizational units.</para>
615 <term>--full-dn</term>
617 Display DNs including the base DN.
624 <title>ou listobjects <replaceable>ou_dn</replaceable> [options]</title>
625 <para>List all objects in an organizational unit.</para>
626 <para>The name of the organizational unit can be specified as a full DN
627 or without the domainDN component.</para>
631 <term>--full-dn</term>
633 Display DNs including the base DN.
638 <term>-r|--recursive</term>
640 List objects recursively.
647 <title>ou move <replaceable>old_ou_dn</replaceable> <replaceable>new_parent_dn</replaceable> [options]</title>
648 <para>Move an organizational unit.</para>
649 <para>The name of the organizational units can be specified as a full DN
650 or without the domainDN component.</para>
654 <title>ou rename <replaceable>old_ou_dn</replaceable> <replaceable>new_ou_dn</replaceable> [options]</title>
655 <para>Rename an organizational unit.</para>
656 <para>The name of the organizational units can be specified as a full DN
657 or without the domainDN component.</para>
662 <para>Manage Read-Only Domain Controller (RODC).</para>
666 <title>rodc preload <replaceable>SID</replaceable>|<replaceable>DN</replaceable>|<replaceable>accountname</replaceable> [options]</title>
667 <para>Preload one account for an RODC.</para>
672 <para>Manage sites.</para>
676 <title>sites create <replaceable>site</replaceable> [options]</title>
677 <para>Create a new site.</para>
681 <title>sites remove <replaceable>site</replaceable> [options]</title>
682 <para>Delete an existing site.</para>
687 <para>Manage Service Principal Names (SPN).</para>
691 <title>spn add <replaceable>name</replaceable> <replaceable>user</replaceable> [options]</title>
692 <para>Create a new SPN.</para>
696 <title>spn delete <replaceable>name</replaceable> [<replaceable>user</replaceable>] [options]</title>
697 <para>Delete an existing SPN.</para>
701 <title>spn list <replaceable>user</replaceable> [options]</title>
702 <para>List SPNs of a given user.</para>
706 <title>testparm</title>
707 <para>Check the syntax of the configuration file.</para>
712 <para>Retrieve the time on a server.</para>
717 <para>Manage users.</para>
721 <title>user add <replaceable>username</replaceable> [<replaceable>password</replaceable>]</title>
722 <para>Create a new user. Please note that this subcommand is deprecated
723 and available for compatibility reasons only. Please use
724 <command>samba-tool user create</command> instead.</para>
728 <title>user create <replaceable>username</replaceable> [<replaceable>password</replaceable>]</title>
729 <para>Create a new user in the Active Directory Domain.</para>
733 <title>user delete <replaceable>username</replaceable> [options]</title>
734 <para>Delete an existing user account.</para>
738 <title>user disable <replaceable>username</replaceable></title>
739 <para>Disable an user account.</para>
743 <title>user enable <replaceable>username</replaceable></title>
744 <para>Enable an user account.</para>
748 <title>user list</title>
749 <para>List all users.</para>
753 <title>user show <replaceable>username</replaceable> [options]</title>
754 <para>Display a user AD object.</para>
758 <term>--attributes=USER_ATTRS</term>
760 Comma separated list of attributes, which will be printed.
767 <title>user move <replaceable>username</replaceable> <replaceable>new_parent_dn</replaceable> [options]</title>
768 <para>This command moves a user account into the specified
769 organizational unit or container.</para>
770 <para>The username specified on the command is the
771 sAMAccountName.</para>
772 <para>The name of the organizational unit or container can be
773 specified as a full DN or without the domainDN component.</para>
777 <title>user password [options]</title>
778 <para>Change password for an user account (the one provided in
779 authentication).</para>
783 <title>user setexpiry <replaceable>username</replaceable> [options]</title>
784 <para>Set the expiration of an user account.</para>
788 <title>user setpassword <replaceable>username</replaceable> [options]</title>
789 <para>Sets or resets the password of an user account.</para>
793 <title>user getpassword <replaceable>username</replaceable> [options]</title>
794 <para>Gets the password of an user account.</para>
798 <title>user syncpasswords <replaceable>--cache-ldb-initialize</replaceable> [options]</title>
799 <para>Syncs the passwords of all user accounts, using an optional script.</para>
800 <para>Note that this command should run on a single domain controller only
801 (typically the PDC-emulator).</para>
805 <title>vampire [options] <replaceable>domain</replaceable></title>
806 <para>Join and synchronise a remote AD domain to the local server.
807 Please note that <command>samba-tool vampire</command> is deprecated,
808 please use <command>samba-tool domain join</command> instead.</para>
812 <title>visualize [options] <replaceable>subcommand</replaceable></title>
813 <para>Produce graphical representations of Samba network state.
814 To work out what is happening in a replication graph, it is sometimes
815 helpful to use visualisations.</para>
818 There are two subcommands, two graphical modes, and (roughly) two modes
819 of operation with respect to the location of authority.</para>
821 <refsect3><title>MODES OF OPERATION</title>
823 <term>samba-tool visualize ntdsconn</term>
824 <listitem><para>Looks at NTDS connections.
829 <term>samba-tool visualize reps</term>
830 <listitem><para>Looks at repsTo and repsFrom objects.
835 <refsect3><title>GRAPHICAL MODES</title>
837 <term>--distance</term>
838 <listitem><para>Distances between DCs are shown in a matrix in
845 <listitem><para>Generate Graphviz dot output. When viewed using
846 dot or xdot, this shows the network as a graph with DCs as
847 vertices and connections edges. Certain types of degenerate
848 edges are shown in different colours or line-styles.
855 <listitem><para>Normally, <command>samba-tool</command> talks
856 to one database; with the <arg choice="opt">-r</arg> option
857 attempts are made to contact all the DCs known to the first
858 database. This is necessary to get sensible results from
859 <command>samba-tool visualize reps</command> because the
860 repsFrom/To objects are not replicated, and it can reveal
861 replication issues in other modes.
868 <para>Gives usage information.</para>
874 <title>VERSION</title>
876 <para>This man page is complete for version &doc.version; of the Samba
881 <title>AUTHOR</title>
883 <para>The original Samba software and related utilities
884 were created by Andrew Tridgell. Samba is now developed
885 by the Samba Team as an Open Source project similar
886 to the way the Linux kernel is developed.</para>