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">
6 <refentrytitle>net</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>net</refname>
16 <refpurpose>Tool for administration of Samba and remote
23 <command>net</command>
24 <arg choice="req"><ads|rap|rpc></arg>
25 <arg choice="opt">-h|--help</arg>
26 <arg choice="opt">-w|--workgroup workgroup</arg>
27 <arg choice="opt">-W|--myworkgroup myworkgroup</arg>
28 <arg choice="opt">-U|--user user</arg>
29 <arg choice="opt">-A|--authentication-file authfile</arg>
30 <arg choice="opt">-I|--ipaddress ip-address</arg>
31 <arg choice="opt">-p|--port port</arg>
32 <arg choice="opt">-n myname</arg>
33 <arg choice="opt">-s conffile</arg>
34 <arg choice="opt">-S|--server server</arg>
35 <arg choice="opt">-l|--long</arg>
36 <arg choice="opt">-v|--verbose</arg>
37 <arg choice="opt">-f|--force</arg>
38 <arg choice="opt">-P|--machine-pass</arg>
39 <arg choice="opt">-d debuglevel</arg>
40 <arg choice="opt">-V</arg>
41 <arg choice="opt">--request-timeout seconds</arg>
42 <arg choice="opt">-t|--timeout seconds</arg>
43 <arg choice="opt">-i|--stdin</arg>
44 <arg choice="opt">--tallocreport</arg>
49 <title>DESCRIPTION</title>
51 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
52 <manvolnum>7</manvolnum></citerefentry> suite.</para>
54 <para>The Samba net utility is meant to work just like the net utility
55 available for windows and DOS. The first argument should be used
56 to specify the protocol to use when executing a certain command.
57 ADS is used for ActiveDirectory, RAP is using for old (Win9x/NT3)
58 clients and RPC can be used for NT4 and Windows 2000. If this
59 argument is omitted, net will try to determine it automatically.
60 Not all commands are available on all protocols.
66 <title>OPTIONS</title>
73 <term>-w|--workgroup target-workgroup</term>
75 Sets target workgroup or domain. You have to specify
76 either this option or the IP address or the name of a server.
81 <term>-W|--myworkgroup workgroup</term>
83 Sets client workgroup or domain
88 <term>-U|--user user</term>
95 <term>-I|--ipaddress ip-address</term>
97 IP address of target server to use. You have to
98 specify either this option or a target workgroup or
104 <term>-p|--port port</term>
106 Port on the target server to connect to (usually 139 or 445).
107 Defaults to trying 445 first, then 139.
111 &stdarg.netbios.name;
114 <term>-S|--server server</term>
116 Name of target server. You should specify either
117 this option or a target workgroup or a target IP address.
122 <term>-l|--long</term>
124 When listing data, give more information on each item.
129 <term>-v|--verbose</term>
131 When listing data, give more verbose information on each item.
136 <term>-f|--force</term>
138 Enforcing a net command.
143 <term>-P|--machine-pass</term>
145 Make queries to the external server using the machine account of the local server.
150 <term>--request-timeout 30</term>
152 Let client requests timeout after 30 seconds the default is 10
158 <term>-t|--timeout 30</term>
160 Set timeout for client operations to 30 seconds.
165 <term>--use-ccache</term>
167 Try to use the credentials cached by winbind.
172 <term>-i|--stdin</term>
174 Take input for net commands from standard input.
179 <term>--tallocreport</term>
181 Generate a talloc report while processing a net
187 <term>-T|--test</term>
188 <listitem><para>Only test command sequence, dry-run.
193 <term>-F|--flags FLAGS</term>
194 <listitem><para>Pass down integer flags to a net subcommand.
199 <term>-C|--comment COMMENT</term>
200 <listitem><para>Pass down a comment string to a net subcommand.
205 <term>-n|--myname MYNAME</term>
206 <listitem><para>Use MYNAME as a requester name for a net subcommand.
211 <term>-c|--container CONTAINER</term>
212 <listitem><para>Use a specific AD container for net ads operations.
217 <term>-M|--maxusers MAXUSERS</term>
218 <listitem><para>Fill in the maxusers field in net rpc share operations.
223 <term>-r|--reboot</term>
224 <listitem><para>Reboot a remote machine after a command has been successfully executed (e.g. in remote join operations).
228 <!-- Options for net rpc vampire -->
231 <term>--force-full-repl</term>
233 When calling "net rpc vampire keytab" this option
234 enforces a full re-creation of the generated keytab file.
239 <term>--single-obj-repl</term>
241 When calling "net rpc vampire keytab" this option
242 allows one to replicate just a single object to the generated keytab file.
247 <term>--clean-old-entries</term>
249 When calling "net rpc vampire keytab" this option
250 allows one to cleanup old entries from the generated keytab file.
254 <!-- Options for net idmap -->
258 <listitem><para>Define dbfile for "net idmap" commands.
264 <listitem><para>Activates locking of the dbfile for "net idmap check" command.
269 <term>-a|--auto</term>
270 <listitem><para>Activates noninteractive mode in "net idmap check".
275 <term>--repair</term>
276 <listitem><para>Activates repair mode in "net idmap check".
280 <!-- Options for net rpc share migrate -->
284 <listitem><para>Includes ACLs to be copied in "net rpc share migrate".
290 <listitem><para>Includes file attributes to be copied in "net rpc share migrate".
295 <term>--timestamps</term>
296 <listitem><para>Includes timestamps to be copied in "net rpc share migrate".
301 <term>-X|--exclude DIRECTORY</term>
302 <listitem><para>Allows one to exclude directories when copying with "net rpc share migrate".
307 <term>--destination SERVERNAME</term>
308 <listitem><para>Defines the target servername of migration process (defaults to localhost).
312 <!-- Options for net groupmap set -->
315 <term>-L|--local</term>
316 <listitem><para>Sets the type of group mapping to local
317 (used in "net groupmap set").
322 <term>-D|--domain</term>
323 <listitem><para>Sets the type of group mapping to domain
324 (used in "net groupmap set").
329 <term>-N|--ntname NTNAME</term>
330 <listitem><para>Sets the ntname of a group mapping
331 (used in "net groupmap set").
336 <term>-R|--rid RID</term>
337 <listitem><para>Sets the rid of a group mapping
338 (used in "net groupmap set").
342 <!-- Options for net registry check -->
345 <term>--reg-version REG_VERSION</term>
346 <listitem><para>Assume database version {n|1,2,3}
347 (used in "net registry check").
352 <term>-o|--output FILENAME</term>
353 <listitem><para>Output database file
354 (used in "net registry check").
360 <listitem><para>Create a new database from scratch
361 (used in "net registry check").
365 <!-- Options for net registry import -->
368 <term>--precheck PRECHECK_DB_FILENAME</term>
369 <listitem><para>Defines filename for database prechecking
370 (used in "net registry import").
375 <term>--no-dns-updates</term>
376 <listitem><para>Do not perform DNS updates as part of
382 <term>--keep-account</term>
383 <listitem><para>Prevent the machine account removal as
384 part of "net ads leave".
390 <listitem><para>Report results in JSON format for
391 "net ads info" and "net ads lookup".
396 &popt.common.samba.client;
402 <title>COMMANDS</title>
405 <title>CHANGESECRETPW</title>
407 <para>This command allows the Samba machine account password to be set from an external application
408 to a machine account password that has already been stored in Active Directory. DO NOT USE this command
409 unless you know exactly what you are doing. The use of this command requires that the force flag (-f)
410 be used also. There will be NO command prompt. Whatever information is piped into stdin, either by
411 typing at the command line or otherwise, will be stored as the literal machine password. Do NOT use
412 this without care and attention as it will overwrite a legitimate machine password without warning.
413 YOU HAVE BEEN WARNED.
421 <para>The <command>NET TIME</command> command allows you to view the time on a remote server
422 or synchronise the time on the local server with the time on the remote server.</para>
427 <para>Without any options, the <command>NET TIME</command> command
428 displays the time on the remote server. The remote server must be
429 specified with the -S option.
435 <title>TIME SYSTEM</title>
437 <para>Displays the time on the remote server in a format ready for <command>/bin/date</command>.
438 The remote server must be specified with the -S option.
444 <title>TIME SET</title>
445 <para>Tries to set the date and time of the local server to that on
446 the remote server using <command>/bin/date</command>.
447 The remote server must be specified with the -S option.
453 <title>TIME ZONE</title>
455 <para>Displays the timezone in hours from GMT on the remote server.
456 The remote server must be specified with the -S option.
463 <title>[RPC|ADS] JOIN [TYPE] [--no-dns-updates] [-U username[%password]]
464 [createupn=UPN] [createcomputer=OU] [machinepass=PASS]
465 [osName=string osVer=string] [options]</title>
468 Join a domain. If the account already exists on the server, and
469 [TYPE] is MEMBER, the machine will attempt to join automatically.
470 (Assuming that the machine has been created in server manager)
471 Otherwise, a password will be prompted for, and a new account may
475 [TYPE] may be PDC, BDC or MEMBER to specify the type of server
480 [UPN] (ADS only) set the principalname attribute during the join. The default
481 format is host/netbiosname@REALM.
485 [OU] (ADS only) Precreate the computer account in a specific OU. The
486 OU string reads from top to bottom without RDNs, and is delimited by
487 a '/'. Please note that '\' is used for escape by both the shell
488 and ldap, so it may need to be doubled or quadrupled to pass through,
489 and it is not used as a delimiter.
492 [PASS] (ADS only) Set a specific password on the computer account
493 being created by the join.
496 [osName=string osVer=String] (ADS only) Set the operatingSystem and
497 operatingSystemVersion attribute during the join. Both parameters
498 must be specified for either to take effect.
503 <title>[RPC] OLDJOIN [options]</title>
505 <para>Join a domain. Use the OLDJOIN option to join the domain
506 using the old style of domain joining - you need to create a trust
507 account in server manager first.</para>
511 <title>[RPC|ADS] USER</title>
514 <title>[RPC|ADS] USER</title>
516 <para>List all users</para>
521 <title>[RPC|ADS] USER DELETE <replaceable>target</replaceable></title>
523 <para>Delete specified user</para>
528 <title>[RPC|ADS] USER INFO <replaceable>target</replaceable></title>
530 <para>List the domain groups of the specified user.</para>
535 <title>[RPC|ADS] USER RENAME <replaceable>oldname</replaceable> <replaceable>newname</replaceable></title>
537 <para>Rename specified user.</para>
542 <title>[RPC|ADS] USER ADD <replaceable>name</replaceable> [password] [-F user flags] [-C comment]</title>
544 <para>Add specified user.</para>
549 <title>[RPC|ADS] GROUP</title>
552 <title>[RPC|ADS] GROUP [misc options] [targets]</title>
553 <para>List user groups.</para>
557 <title>[RPC|ADS] GROUP DELETE <replaceable>name</replaceable> [misc. options]</title>
559 <para>Delete specified group.</para>
564 <title>[RPC|ADS] GROUP ADD <replaceable>name</replaceable> [-C comment]</title>
566 <para>Create specified group.</para>
570 <title>[ADS] LOOKUP</title>
572 <para>Lookup the closest Domain Controller in our domain and retrieve server information about it.</para>
578 <title>[RAP|RPC] SHARE</title>
581 <title>[RAP|RPC] SHARE [misc. options] [targets]</title>
583 <para>Enumerates all exported resources (network shares) on target server.</para>
588 <title>[RAP|RPC] SHARE ADD <replaceable>name=serverpath</replaceable> [-C comment] [-M maxusers] [targets]</title>
590 <para>Adds a share from a server (makes the export active). Maxusers
591 specifies the number of users that can be connected to the
592 share simultaneously.</para>
597 <title>SHARE DELETE <replaceable>sharename</replaceable></title>
599 <para>Delete specified share.</para>
604 <title>[RPC|RAP] FILE</title>
607 <title>[RPC|RAP] FILE</title>
609 <para>List all open files on remote server.</para>
614 <title>[RPC|RAP] FILE CLOSE <replaceable>fileid</replaceable></title>
616 <para>Close file with specified <replaceable>fileid</replaceable> on
617 remote server.</para>
622 <title>[RPC|RAP] FILE INFO <replaceable>fileid</replaceable></title>
625 Print information on specified <replaceable>fileid</replaceable>.
626 Currently listed are: file-id, username, locks, path, permissions.
632 <title>[RAP|RPC] FILE USER <replaceable>user</replaceable></title>
635 List files opened by specified <replaceable>user</replaceable>.
636 Please note that <command>net rap file user</command> does not work
637 against Samba servers.
645 <title>SESSION</title>
648 <title>RAP SESSION</title>
650 <para>Without any other options, SESSION enumerates all active SMB/CIFS
651 sessions on the target server.</para>
656 <title>RAP SESSION DELETE|CLOSE <replaceable>CLIENT_NAME</replaceable></title>
658 <para>Close the specified sessions.</para>
663 <title>RAP SESSION INFO <replaceable>CLIENT_NAME</replaceable></title>
665 <para>Give a list with all the open files in specified session.</para>
672 <title>RAP SERVER <replaceable>DOMAIN</replaceable></title>
674 <para>List all servers in specified domain or workgroup. Defaults
675 to local domain.</para>
680 <title>RAP DOMAIN</title>
682 <para>Lists all domains and workgroups visible on the
683 current network.</para>
688 <title>RAP PRINTQ</title>
691 <title>RAP PRINTQ INFO <replaceable>QUEUE_NAME</replaceable></title>
693 <para>Lists the specified print queue and print jobs on the server.
694 If the <replaceable>QUEUE_NAME</replaceable> is omitted, all
695 queues are listed.</para>
700 <title>RAP PRINTQ DELETE <replaceable>JOBID</replaceable></title>
702 <para>Delete job with specified id.</para>
709 <title>RAP VALIDATE <replaceable>user</replaceable> [<replaceable>password</replaceable>]</title>
712 Validate whether the specified user can log in to the
713 remote server. If the password is not specified on the commandline, it
722 <title>RAP GROUPMEMBER</title>
725 <title>RAP GROUPMEMBER LIST <replaceable>GROUP</replaceable></title>
727 <para>List all members of the specified group.</para>
732 <title>RAP GROUPMEMBER DELETE <replaceable>GROUP</replaceable> <replaceable>USER</replaceable></title>
734 <para>Delete member from group.</para>
739 <title>RAP GROUPMEMBER ADD <replaceable>GROUP</replaceable> <replaceable>USER</replaceable></title>
741 <para>Add member to group.</para>
748 <title>RAP ADMIN <replaceable>command</replaceable></title>
750 <para>Execute the specified <replaceable>command</replaceable> on
751 the remote server. Only works with OS/2 servers.
759 <title>RAP SERVICE</title>
762 <title>RAP SERVICE START <replaceable>NAME</replaceable> [arguments...]</title>
764 <para>Start the specified service on the remote server. Not implemented yet.</para>
771 <title>RAP SERVICE STOP</title>
773 <para>Stop the specified service on the remote server.</para>
782 <title>RAP PASSWORD <replaceable>USER</replaceable> <replaceable>OLDPASS</replaceable> <replaceable>NEWPASS</replaceable></title>
785 Change password of <replaceable>USER</replaceable> from <replaceable>OLDPASS</replaceable> to <replaceable>NEWPASS</replaceable>.
791 <title>LOOKUP</title>
794 <title>LOOKUP HOST <replaceable>HOSTNAME</replaceable> [<replaceable>TYPE</replaceable>]</title>
797 Lookup the IP address of the given host with the specified type (netbios suffix).
798 The type defaults to 0x20 (workstation).
804 <title>LOOKUP LDAP [<replaceable>DOMAIN</replaceable>]</title>
806 <para>Give IP address of LDAP server of specified <replaceable>DOMAIN</replaceable>. Defaults to local domain.</para>
811 <title>LOOKUP KDC [<replaceable>REALM</replaceable>]</title>
813 <para>Give IP address of KDC for the specified <replaceable>REALM</replaceable>.
814 Defaults to local realm.</para>
819 <title>LOOKUP DC [<replaceable>DOMAIN</replaceable>]</title>
821 <para>Give IP's of Domain Controllers for specified <replaceable>
822 DOMAIN</replaceable>. Defaults to local domain.</para>
827 <title>LOOKUP MASTER <replaceable>DOMAIN</replaceable></title>
829 <para>Give IP of master browser for specified <replaceable>DOMAIN</replaceable>
830 or workgroup. Defaults to local domain.</para>
835 <title>LOOKUP NAME [<replaceable>NAME</replaceable>]</title>
837 <para>Lookup username's sid and type for specified <replaceable>NAME</replaceable>
843 <title>LOOKUP SID [<replaceable>SID</replaceable>]</title>
845 <para>Give sid's name and type for specified <replaceable>SID</replaceable>
851 <title>LOOKUP DSGETDCNAME [<replaceable>NAME</replaceable>] [<replaceable>FLAGS</replaceable>] [<replaceable>SITENAME</replaceable>]</title>
853 <para>Give Domain Controller information for specified domain <replaceable>NAME</replaceable>
863 <para>Samba uses a general caching interface called 'gencache'. It
864 can be controlled using 'NET CACHE'.</para>
866 <para>All the timeout parameters support the suffixes:
869 <member>s - Seconds</member>
870 <member>m - Minutes</member>
871 <member>h - Hours</member>
872 <member>d - Days</member>
873 <member>w - Weeks</member>
879 <title>CACHE ADD <replaceable>key</replaceable> <replaceable>data</replaceable> <replaceable>time-out</replaceable></title>
881 <para>Add specified key+data to the cache with the given timeout.</para>
886 <title>CACHE DEL <replaceable>key</replaceable></title>
888 <para>Delete key from the cache.</para>
893 <title>CACHE SET <replaceable>key</replaceable> <replaceable>data</replaceable> <replaceable>time-out</replaceable></title>
895 <para>Update data of existing cache entry.</para>
900 <title>CACHE SEARCH <replaceable>PATTERN</replaceable></title>
902 <para>Search for the specified pattern in the cache data.</para>
907 <title>CACHE LIST</title>
910 List all current items in the cache.
916 <title>CACHE FLUSH</title>
918 <para>Remove all the current items from the cache.</para>
925 <title>GETLOCALSID [DOMAIN]</title>
927 <para>Prints the SID of the specified domain, or if the parameter is
928 omitted, the SID of the local server.</para>
933 <title>SETLOCALSID S-1-5-21-x-y-z</title>
935 <para>Sets SID for the local server to the specified SID.</para>
940 <title>GETDOMAINSID</title>
942 <para>Prints the local machine SID and the SID of the current
948 <title>SETDOMAINSID</title>
950 <para>Sets the SID of the current domain.</para>
955 <title>GROUPMAP</title>
957 <para>Manage the mappings between Windows group SIDs and UNIX groups.
958 Common options include:</para>
961 <listitem><para>unixgroup - Name of the UNIX group</para></listitem>
962 <listitem><para>ntgroup - Name of the Windows NT group (must be
963 resolvable to a SID</para></listitem>
964 <listitem><para>rid - Unsigned 32-bit integer</para></listitem>
965 <listitem><para>sid - Full SID in the form of "S-1-..."</para></listitem>
966 <listitem><para>type - Type of the group; either 'domain', 'local',
967 or 'builtin'</para></listitem>
968 <listitem><para>comment - Freeform text description of the group</para></listitem>
972 <title>GROUPMAP ADD</title>
975 Add a new group mapping entry:
977 net groupmap add {rid=int|sid=string} unixgroup=string \
978 [type={domain|local}] [ntgroup=string] [comment=string]
985 <title>GROUPMAP DELETE</title>
987 <para>Delete a group mapping entry. If more than one group name matches, the first entry found is deleted.</para>
989 <para>net groupmap delete {ntgroup=string|sid=SID}</para>
994 <title>GROUPMAP MODIFY</title>
996 <para>Update an existing group entry.</para>
1000 net groupmap modify {ntgroup=string|sid=SID} [unixgroup=string] \
1001 [comment=string] [type={domain|local}]
1007 <title>GROUPMAP LIST</title>
1009 <para>List existing group mapping entries.</para>
1011 <para>net groupmap list [verbose] [ntgroup=string] [sid=SID]</para>
1019 <title>MAXRID</title>
1021 <para>Prints out the highest RID currently in use on the local
1022 server (by the active 'passdb backend').
1028 <title>RPC INFO</title>
1030 <para>Print information about the domain of the remote server,
1031 such as domain name, domain sid and number of users and groups.
1037 <title>[RPC|ADS] TESTJOIN</title>
1039 <para>Check whether participation in a domain is still valid.</para>
1044 <title>[RPC|ADS] CHANGETRUSTPW</title>
1046 <para>Force change of domain trust password.</para>
1051 <title>RPC TRUSTDOM</title>
1054 <title>RPC TRUSTDOM ADD <replaceable>DOMAIN</replaceable></title>
1056 <para>Add a interdomain trust account for <replaceable>DOMAIN</replaceable>.
1057 This is in fact a Samba account named <replaceable>DOMAIN$</replaceable>
1058 with the account flag <constant>'I'</constant> (interdomain trust account).
1059 This is required for incoming trusts to work. It makes Samba be a
1060 trusted domain of the foreign (trusting) domain.
1061 Users of the Samba domain will be made available in the foreign domain.
1062 If the command is used against localhost it has the same effect as
1063 <command>smbpasswd -a -i DOMAIN</command>. Please note that both commands
1064 expect a appropriate UNIX account.
1070 <title>RPC TRUSTDOM DEL <replaceable>DOMAIN</replaceable></title>
1072 <para>Remove interdomain trust account for
1073 <replaceable>DOMAIN</replaceable>. If it is used against localhost
1074 it has the same effect as <command>smbpasswd -x DOMAIN$</command>.
1080 <title>RPC TRUSTDOM ESTABLISH <replaceable>DOMAIN</replaceable></title>
1083 Establish a trust relationship to a trusted domain.
1084 Interdomain account must already be created on the remote PDC.
1085 This is required for outgoing trusts to work. It makes Samba be a
1086 trusting domain of a foreign (trusted) domain.
1087 Users of the foreign domain will be made available in our domain.
1088 You'll need winbind and a working idmap config to make them
1089 appear in your system.
1095 <title>RPC TRUSTDOM REVOKE <replaceable>DOMAIN</replaceable></title>
1096 <para>Abandon relationship to trusted domain</para>
1101 <title>RPC TRUSTDOM LIST</title>
1103 <para>List all interdomain trust relationships.</para>
1109 <title>RPC TRUST</title>
1112 <title>RPC TRUST CREATE</title>
1114 <para>Create a trust object by calling lsaCreateTrustedDomainEx2.
1115 The can be done on a single server or on two servers at once with the
1116 possibility to use a random trust password.</para>
1118 <variablelist><title>Options:</title>
1120 <term>otherserver</term>
1121 <listitem><para>Domain controller of the second domain</para></listitem>
1125 <term>otheruser</term>
1126 <listitem><para>Admin user in the second domain</para></listitem>
1130 <term>otherdomainsid</term>
1131 <listitem><para>SID of the second domain</para></listitem>
1135 <term>other_netbios_domain</term>
1136 <listitem><para>NetBIOS (short) name of the second domain</para></listitem>
1140 <term>otherdomain</term>
1141 <listitem><para>DNS (full) name of the second domain</para></listitem>
1145 <term>trustpw</term>
1146 <listitem><para>Trust password</para></listitem>
1150 <variablelist><title>Examples:</title>
1152 <term>Create a trust object on srv1.dom1.dom for the domain dom2</term>
1153 <listitem><literallayout>
1154 net rpc trust create \
1155 otherdomainsid=S-x-x-xx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxx \
1156 other_netbios_domain=dom2 \
1157 otherdomain=dom2.dom \
1160 </literallayout></listitem>
1163 <term>Create a trust relationship between dom1 and dom2</term>
1164 <listitem><literallayout>
1165 net rpc trust create \
1166 otherserver=srv2.dom2.test \
1169 </literallayout></listitem>
1175 <title>RPC TRUST DELETE</title>
1177 <para>Delete a trust object by calling lsaDeleteTrustedDomain.
1178 The can be done on a single server or on two servers at once.</para>
1180 <variablelist><title>Options:</title>
1182 <term>otherserver</term>
1183 <listitem><para>Domain controller of the second domain</para></listitem>
1187 <term>otheruser</term>
1188 <listitem><para>Admin user in the second domain</para></listitem>
1192 <term>otherdomainsid</term>
1193 <listitem><para>SID of the second domain</para></listitem>
1197 <variablelist><title>Examples:</title>
1199 <term>Delete a trust object on srv1.dom1.dom for the domain dom2</term>
1200 <listitem><literallayout>
1201 net rpc trust delete \
1202 otherdomainsid=S-x-x-xx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxx \
1204 </literallayout></listitem>
1207 <term>Delete a trust relationship between dom1 and dom2</term>
1208 <listitem><literallayout>
1209 net rpc trust delete \
1210 otherserver=srv2.dom2.test \
1213 </literallayout></listitem>
1222 <title>RPC RIGHTS</title>
1224 <para>This subcommand is used to view and manage Samba's rights assignments (also
1225 referred to as privileges). There are three options currently available:
1226 <parameter>list</parameter>, <parameter>grant</parameter>, and
1227 <parameter>revoke</parameter>. More details on Samba's privilege model and its use
1228 can be found in the Samba-HOWTO-Collection.</para>
1236 <title>RPC ABORTSHUTDOWN</title>
1238 <para>Abort the shutdown of a remote server.</para>
1243 <title>RPC SHUTDOWN [-t timeout] [-r] [-f] [-C message]</title>
1245 <para>Shut down the remote server.</para>
1251 Reboot after shutdown.
1258 Force shutting down all applications.
1263 <term>-t timeout</term>
1265 Timeout before system will be shut down. An interactive
1266 user of the system can use this time to cancel the shutdown.
1271 <term>-C message</term>
1272 <listitem><para>Display the specified message on the screen to
1273 announce the shutdown.</para></listitem>
1280 <title>RPC SAMDUMP</title>
1282 <para>Print out sam database of remote server. You need
1283 to run this against the PDC, from a Samba machine joined as a BDC. </para>
1287 <title>RPC VAMPIRE</title>
1289 <para>Export users, aliases and groups from remote server to
1290 local server. You need to run this against the PDC, from a Samba machine joined as a BDC.
1291 This vampire command cannot be used against an Active Directory, only
1292 against an NT4 Domain Controller.
1297 <title>RPC VAMPIRE KEYTAB</title>
1299 <para>Dump remote SAM database to local Kerberos keytab file.
1304 <title>RPC VAMPIRE LDIF</title>
1306 <para>Dump remote SAM database to local LDIF file or standard output.
1311 <title>RPC GETSID</title>
1313 <para>Fetch domain SID and store it in the local <filename>secrets.tdb</filename>. </para>
1318 <title>ADS LEAVE [--keep-account]</title>
1320 <para>Make the remote host leave the domain it is part of. </para>
1325 <title>ADS STATUS</title>
1327 <para>Print out status of machine account of the local machine in ADS.
1328 Prints out quite some debug info. Aimed at developers, regular
1329 users should use <command>NET ADS TESTJOIN</command>.</para>
1334 <title>ADS PRINTER</title>
1337 <title>ADS PRINTER INFO [<replaceable>PRINTER</replaceable>] [<replaceable>SERVER</replaceable>]</title>
1340 Lookup info for <replaceable>PRINTER</replaceable> on <replaceable>SERVER</replaceable>. The printer name defaults to "*", the
1341 server name defaults to the local host.</para>
1346 <title>ADS PRINTER PUBLISH <replaceable>PRINTER</replaceable></title>
1348 <para>Publish specified printer using ADS.</para>
1353 <title>ADS PRINTER REMOVE <replaceable>PRINTER</replaceable></title>
1355 <para>Remove specified printer from ADS directory.</para>
1362 <title>ADS SEARCH <replaceable>EXPRESSION</replaceable> <replaceable>ATTRIBUTES...</replaceable></title>
1364 <para>Perform a raw LDAP search on a ADS server and dump the results. The
1365 expression is a standard LDAP search expression, and the
1366 attributes are a list of LDAP fields to show in the results.</para>
1368 <para>Example: <userinput>net ads search '(objectCategory=group)' sAMAccountName</userinput>
1374 <title>ADS DN <replaceable>DN</replaceable> <replaceable>(attributes)</replaceable></title>
1377 Perform a raw LDAP search on a ADS server and dump the results. The
1378 DN standard LDAP DN, and the attributes are a list of LDAP fields
1379 to show in the result.
1382 <para>Example: <userinput>net ads dn 'CN=administrator,CN=Users,DC=my,DC=domain' SAMAccountName</userinput></para>
1387 <title>ADS KEYTAB <replaceable>CREATE</replaceable></title>
1390 Creates a new keytab file if one doesn't exist with default entries. Default
1391 entries are kerberos principals created from the machinename of the
1392 client, the UPN (if it exists) and any Windows SPN(s) associated with the
1393 computer AD account for the client. If a keytab file already exists then only
1394 missing kerberos principals from the default entries are added. No changes
1395 are made to the computer AD account.
1400 <title>ADS KEYTAB <replaceable>ADD</replaceable> <replaceable>(principal | machine | serviceclass | windows SPN</replaceable></title>
1403 Adds a new keytab entry, the entry can be either;
1405 <varlistentry><term>kerberos principal</term>
1407 A kerberos principal (identified by the presence of '@') is just
1408 added to the keytab file.
1411 <varlistentry><term>machinename</term>
1413 A machinename (identified by the trailing '$') is used to create a
1414 a kerberos principal 'machinename@realm' which is added to the
1418 <varlistentry><term>serviceclass</term>
1420 A serviceclass (such as 'cifs', 'html' etc.) is used to create a pair
1421 of kerberos principals 'serviceclass/fully_qualified_dns_name@realm' &
1422 'serviceclass/netbios_name@realm' which are added to the keytab file.
1425 <varlistentry><term>Windows SPN</term>
1427 A Windows SPN is of the format 'serviceclass/host:port', it is used to
1428 create a kerberos principal 'serviceclass/host@realm' which will
1429 be written to the keytab file.
1435 Unlike old versions no computer AD objects are modified by this command. To
1436 preserve the bevhaviour of older clients 'net ads keytab ad_update_ads' is
1442 <title>ADS KEYTAB <replaceable>ADD_UPDATE_ADS</replaceable> <replaceable>(principal | machine | serviceclass | windows SPN</replaceable></title>
1445 Adds a new keytab entry (see section for net ads keytab add). In addition to
1446 adding entries to the keytab file corrosponding Windows SPNs are created
1447 from the entry passed to this command. These SPN(s) added to the AD computer
1448 account object associated with the client machine running this command for
1449 the following entry types;
1451 <varlistentry><term>serviceclass</term>
1453 A serviceclass (such as 'cifs', 'html' etc.) is used to create a
1454 pair of Windows SPN(s) 'param/full_qualified_dns' &
1455 'param/netbios_name' which are added to the AD computer account object
1459 <varlistentry><term>Windows SPN</term>
1461 A Windows SPN is of the format 'serviceclass/host:port', it is
1462 added as passed to the AD computer account object for this client.
1470 <title>ADS setspn <replaceable>SETSPN LIST [machine]</replaceable></title>
1473 Lists the Windows SPNs stored in the 'machine' Windows AD Computer object.
1474 If 'machine' is not specified then computer account for this client is used
1480 <title>ADS setspn <replaceable>SETSPN ADD SPN [machine]</replaceable></title>
1483 Adds the specified Windows SPN to the 'machine' Windows AD Computer object.
1484 If 'machine' is not specified then computer account for this client is used
1491 <title>ADS setspn <replaceable>SETSPN DELETE SPN [machine]</replaceable></title>
1494 DELETE the specified Window SPN from the 'machine' Windows AD Computer
1495 object. If 'machine' is not specified then computer account for this
1503 <title>ADS WORKGROUP</title>
1505 <para>Print out workgroup name for specified kerberos realm.</para>
1510 <title>ADS ENCTYPES</title>
1513 List, modify or delete the value of the "msDS-SupportedEncryptionTypes" attribute of an account in AD.
1517 This attribute allows one to control which Kerberos encryption types are used for the generation of initial and service tickets. The value consists of an integer bitmask with the following values:
1520 <para>0x00000001 DES-CBC-CRC</para>
1521 <para>0x00000002 DES-CBC-MD5</para>
1522 <para>0x00000004 RC4-HMAC</para>
1523 <para>0x00000008 AES128-CTS-HMAC-SHA1-96</para>
1524 <para>0x00000010 AES256-CTS-HMAC-SHA1-96</para>
1529 <title>ADS ENCTYPES LIST <replaceable><ACCOUNTNAME></replaceable></title>
1532 List the value of the "msDS-SupportedEncryptionTypes" attribute of a given account.
1535 <para>Example: <userinput>net ads enctypes list Computername</userinput></para>
1540 <title>ADS ENCTYPES SET <replaceable><ACCOUNTNAME></replaceable> <replaceable>[enctypes]</replaceable></title>
1543 Set the value of the "msDS-SupportedEncryptionTypes" attribute of the LDAP object of ACCOUNTNAME to a given value. If the value is omitted, the value is set to 31 which enables all the currently supported encryption types.
1546 <para>Example: <userinput>net ads enctypes set Computername 24</userinput></para>
1551 <title>ADS ENCTYPES DELETE <replaceable><ACCOUNTNAME></replaceable></title>
1554 Deletes the "msDS-SupportedEncryptionTypes" attribute of the LDAP object of ACCOUNTNAME.
1557 <para>Example: <userinput>net ads enctypes set Computername 24</userinput></para>
1563 <title>SAM CREATEBUILTINGROUP <NAME></title>
1566 (Re)Create a BUILTIN group.
1567 Only a wellknown set of BUILTIN groups can be created with this command.
1568 This is the list of currently recognized group names: Administrators,
1569 Users, Guests, Power Users, Account Operators, Server Operators, Print
1570 Operators, Backup Operators, Replicator, RAS Servers, Pre-Windows 2000
1573 This command requires a running Winbindd with idmap allocation properly
1574 configured. The group gid will be allocated out of the winbindd range.
1580 <title>SAM CREATELOCALGROUP <NAME></title>
1583 Create a LOCAL group (also known as Alias).
1585 This command requires a running Winbindd with idmap allocation properly
1586 configured. The group gid will be allocated out of the winbindd range.
1592 <title>SAM DELETELOCALGROUP <NAME></title>
1595 Delete an existing LOCAL group (also known as Alias).
1602 <title>SAM MAPUNIXGROUP <NAME></title>
1605 Map an existing Unix group and make it a Domain Group, the domain group
1606 will have the same name.
1612 <title>SAM UNMAPUNIXGROUP <NAME></title>
1615 Remove an existing group mapping entry.
1621 <title>SAM ADDMEM <GROUP> <MEMBER></title>
1624 Add a member to a Local group. The group can be specified only by name,
1625 the member can be specified by name or SID.
1631 <title>SAM DELMEM <GROUP> <MEMBER></title>
1634 Remove a member from a Local group. The group and the member must be
1641 <title>SAM LISTMEM <GROUP></title>
1644 List Local group members. The group must be specified by name.
1650 <title>SAM LIST <users|groups|localgroups|builtin|workstations> [verbose]</title>
1653 List the specified set of accounts by name. If verbose is specified,
1654 the rid and description is also provided for each account.
1660 <title>SAM RIGHTS LIST</title>
1663 List all available privileges.
1669 <title>SAM RIGHTS GRANT <NAME> <PRIVILEGE></title>
1672 Grant one or more privileges to a user.
1678 <title>SAM RIGHTS REVOKE <NAME> <PRIVILEGE></title>
1681 Revoke one or more privileges from a user.
1687 <title>SAM SHOW <NAME></title>
1690 Show the full DOMAIN\\NAME the SID and the type for the corresponding
1697 <title>SAM SET HOMEDIR <NAME> <DIRECTORY></title>
1700 Set the home directory for a user account.
1706 <title>SAM SET PROFILEPATH <NAME> <PATH></title>
1709 Set the profile path for a user account.
1715 <title>SAM SET COMMENT <NAME> <COMMENT></title>
1718 Set the comment for a user or group account.
1724 <title>SAM SET FULLNAME <NAME> <FULL NAME></title>
1727 Set the full name for a user account.
1733 <title>SAM SET LOGONSCRIPT <NAME> <SCRIPT></title>
1736 Set the logon script for a user account.
1742 <title>SAM SET HOMEDRIVE <NAME> <DRIVE></title>
1745 Set the home drive for a user account.
1751 <title>SAM SET WORKSTATIONS <NAME> <WORKSTATIONS></title>
1754 Set the workstations a user account is allowed to log in from.
1760 <title>SAM SET DISABLE <NAME></title>
1763 Set the "disabled" flag for a user account.
1769 <title>SAM SET PWNOTREQ <NAME></title>
1772 Set the "password not required" flag for a user account.
1778 <title>SAM SET AUTOLOCK <NAME></title>
1781 Set the "autolock" flag for a user account.
1787 <title>SAM SET PWNOEXP <NAME></title>
1790 Set the "password do not expire" flag for a user account.
1796 <title>SAM SET PWDMUSTCHANGENOW <NAME> [yes|no]</title>
1799 Set or unset the "password must change" flag for a user account.
1805 <title>SAM POLICY LIST</title>
1808 List the available account policies.
1814 <title>SAM POLICY SHOW <account policy></title>
1817 Show the account policy value.
1823 <title>SAM POLICY SET <account policy> <value></title>
1826 Set a value for the account policy.
1827 Valid values can be: "forever", "never", "off", or a number.
1833 <title>SAM PROVISION</title>
1836 Only available if ldapsam:editposix is set and winbindd is running.
1837 Properly populates the ldap tree with the basic accounts (Administrator)
1838 and groups (Domain Users, Domain Admins, Domain Guests) on the ldap tree.
1844 <title>IDMAP DUMP <local tdb file name></title>
1847 Dumps the mappings contained in the local tdb file specified.
1848 This command is useful to dump only the mappings produced by the idmap_tdb backend.
1854 <title>IDMAP RESTORE [input file]</title>
1857 Restore the mappings from the specified file or stdin.
1863 <title>IDMAP SET SECRET <DOMAIN> <secret></title>
1866 Store a secret for the specified domain, used primarily for domains
1867 that use idmap_ldap as a backend. In this case the secret is used
1868 as the password for the user DN used to bind to the ldap server.
1874 <title>IDMAP SET RANGE <RANGE> <SID> [index] [--db=<DB>]</title>
1877 Store a domain-range mapping for a given domain (and index) in autorid database.
1883 <title>IDMAP SET CONFIG <config> [--db=<DB>]</title>
1886 Update CONFIG entry in autorid database.
1892 <title>IDMAP GET RANGE <SID> [index] [--db=<DB>]</title>
1895 Get the range for a given domain and index from autorid database.
1901 <title>IDMAP GET RANGES [<SID>] [--db=<DB>]</title>
1904 Get ranges for all domains or for one identified by given SID.
1910 <title>IDMAP GET CONFIG [--db=<DB>]</title>
1913 Get CONFIG entry from autorid database.
1920 <title>IDMAP DELETE MAPPING [-f] [--db=<DB>] <ID></title>
1923 Delete a mapping sid <-> gid or sid <-> uid from the IDMAP database.
1924 The mapping is given by <ID> which may either be a sid: S-x-..., a gid: "GID number" or a uid: "UID number".
1925 Use -f to delete an invalid partial mapping <ID> -> xx
1928 Use "smbcontrol all idmap ..." to notify running smbd instances.
1929 See the <citerefentry><refentrytitle>smbcontrol</refentrytitle>
1930 <manvolnum>1</manvolnum></citerefentry> manpage for details.
1935 <title>IDMAP DELETE RANGE [-f] [--db=<TDB>] <RANGE>|(<SID> [<INDEX>])</title>
1938 Delete a domain range mapping identified by 'RANGE' or "domain SID and INDEX" from autorid database.
1939 Use -f to delete invalid mappings.
1945 <title>IDMAP DELETE RANGES [-f] [--db=<TDB>] <SID></title>
1948 Delete all domain range mappings for a domain identified by SID.
1949 Use -f to delete invalid mappings.
1956 <title>IDMAP CHECK [-v] [-r] [-a] [-T] [-f] [-l] [--db=<DB>]</title>
1959 Check and repair the IDMAP database. If no option is given a read only check
1960 of the database is done. Among others an interactive or automatic repair mode
1961 may be chosen with one of the following options:
1964 <varlistentry><term>-r|--repair</term>
1966 Interactive repair mode, ask a lot of questions.
1970 <varlistentry><term>-a|--auto</term>
1972 Noninteractive repair mode, use default answers.
1976 <varlistentry><term>-v|--verbose</term>
1978 Produce more output.
1982 <varlistentry><term>-f|--force</term>
1984 Try to apply changes, even if they do not apply cleanly.
1988 <varlistentry><term>-T|--test</term>
1990 Dry run, show what changes would be made but don't touch anything.
1994 <varlistentry><term>-l|--lock</term>
1996 Lock the database while doing the check.
2000 <varlistentry><term>--db <DB></term>
2002 Check the specified database.
2005 <varlistentry><term></term>
2011 It reports about the finding of the following errors:
2014 <varlistentry><term>Missing reverse mapping:</term>
2016 A record with mapping A->B where there is no B->A. Default action
2017 in repair mode is to "fix" this by adding the reverse mapping.
2021 <varlistentry><term>Invalid mapping:</term>
2023 A record with mapping A->B where B->C. Default action
2024 is to "delete" this record.
2028 <varlistentry><term>Missing or invalid HWM:</term>
2030 A high water mark is not at least equal to the largest ID in the
2031 database. Default action is to "fix" this by setting it to the
2032 largest ID found +1.
2036 <varlistentry><term>Invalid record:</term>
2038 Something we failed to parse. Default action is to "edit" it
2039 in interactive and "delete" it in automatic mode.
2048 <title>USERSHARE</title>
2050 <para>Starting with version 3.0.23, a Samba server now supports the ability for
2051 non-root users to add user defined shares to be exported using the "net usershare"
2056 To set this up, first set up your smb.conf by adding to the [global] section:
2058 usershare path = /usr/local/samba/lib/usershares
2060 Next create the directory /usr/local/samba/lib/usershares, change the owner to root and
2061 set the group owner to the UNIX group who should have the ability to create usershares,
2062 for example a group called "serverops".
2064 Set the permissions on /usr/local/samba/lib/usershares to 01770.
2066 (Owner and group all access, no access for others, plus the sticky bit,
2067 which means that a file in that directory can be renamed or deleted only
2068 by the owner of the file).
2070 Finally, tell smbd how many usershares you will allow by adding to the [global]
2071 section of smb.conf a line such as :
2073 usershare max shares = 100.
2075 To allow 100 usershare definitions. Now, members of the UNIX group "serverops"
2076 can create user defined shares on demand using the commands below.
2079 <para>The usershare commands are:
2082 <member>net usershare add sharename path [comment [acl] [guest_ok=[y|n]]] - to add or change a user defined share.</member>
2083 <member>net usershare delete sharename - to delete a user defined share.</member>
2084 <member>net usershare info [-l|--long] [wildcard sharename] - to print info about a user defined share.</member>
2085 <member>net usershare list [-l|--long] [wildcard sharename] - to list user defined shares.</member>
2091 <title>USERSHARE ADD <replaceable>sharename</replaceable> <replaceable>path</replaceable> <replaceable>[comment]</replaceable> <replaceable>[acl]</replaceable> <replaceable>[guest_ok=[y|n]]</replaceable></title>
2094 Add or replace a new user defined share, with name "sharename".
2098 "path" specifies the absolute pathname on the system to be exported.
2099 Restrictions may be put on this, see the global smb.conf parameters:
2100 "usershare owner only", "usershare prefix allow list", and
2101 "usershare prefix deny list".
2105 The optional "comment" parameter is the comment that will appear
2106 on the share when browsed to by a client.
2109 <para>The optional "acl" field
2110 specifies which users have read and write access to the entire share.
2111 Note that guest connections are not allowed unless the smb.conf parameter
2112 "usershare allow guests" has been set. The definition of a user
2113 defined share acl is: "user:permission", where user is a valid
2114 username on the system and permission can be "F", "R", or "D".
2115 "F" stands for "full permissions", ie. read and write permissions.
2116 "D" stands for "deny" for a user, ie. prevent this user from accessing
2118 "R" stands for "read only", ie. only allow read access to this
2119 share (no creation of new files or directories or writing to files).
2123 The default if no "acl" is given is "Everyone:R", which means any
2124 authenticated user has read-only access.
2128 The optional "guest_ok" has the same effect as the parameter of the
2129 same name in smb.conf, in that it allows guest access to this user
2130 defined share. This parameter is only allowed if the global parameter
2131 "usershare allow guests" has been set to true in the smb.conf.
2134 There is no separate command to modify an existing user defined share,
2135 just use the "net usershare add [sharename]" command using the same
2136 sharename as the one you wish to modify and specify the new options
2137 you wish. The Samba smbd daemon notices user defined share modifications
2138 at connect time so will see the change immediately, there is no need
2139 to restart smbd on adding, deleting or changing a user defined share.
2143 <title>USERSHARE DELETE <replaceable>sharename</replaceable></title>
2146 Deletes the user defined share by name. The Samba smbd daemon
2147 immediately notices this change, although it will not disconnect
2148 any users currently connected to the deleted share.
2154 <title>USERSHARE INFO <replaceable>[-l|--long]</replaceable> <replaceable>[wildcard sharename]</replaceable></title>
2157 Get info on user defined shares owned by the current user matching the given pattern, or all users.
2161 net usershare info on its own dumps out info on the user defined shares that were
2162 created by the current user, or restricts them to share names that match the given
2163 wildcard pattern ('*' matches one or more characters, '?' matches only one character).
2164 If the '-l' or '--long' option is also given, it prints out info on user defined
2165 shares created by other users.
2169 The information given about a share looks like:
2174 usershare_acl=Everyone:F
2177 And is a list of the current settings of the user defined share that can be
2178 modified by the "net usershare add" command.
2184 <title>USERSHARE LIST <replaceable>[-l|--long]</replaceable> <replaceable>wildcard sharename</replaceable></title>
2187 List all the user defined shares owned by the current user matching the given pattern, or all users.
2191 net usershare list on its own list out the names of the user defined shares that were
2192 created by the current user, or restricts the list to share names that match the given
2193 wildcard pattern ('*' matches one or more characters, '?' matches only one character).
2194 If the '-l' or '--long' option is also given, it includes the names of user defined
2195 shares created by other users.
2203 <title>[RPC] CONF</title>
2205 <para>Starting with version 3.2.0, a Samba server can be configured by data
2206 stored in registry. This configuration data can be edited with the new "net
2207 conf" commands. There is also the possibility to configure a remote Samba server
2208 by enabling the RPC conf mode and specifying the address of the remote server.
2212 The deployment of this configuration data can be activated in two levels from the
2213 <emphasis>smb.conf</emphasis> file: Share definitions from registry are
2214 activated by setting <parameter>registry shares</parameter> to
2215 <quote>yes</quote> in the [global] section and global configuration options are
2216 activated by setting <smbconfoption name="include">registry</smbconfoption> in
2217 the [global] section for a mixed configuration or by setting
2218 <smbconfoption name="config backend">registry</smbconfoption> in the [global]
2219 section for a registry-only configuration.
2220 See the <citerefentry><refentrytitle>smb.conf</refentrytitle>
2221 <manvolnum>5</manvolnum></citerefentry> manpage for details.
2224 <para>The conf commands are:
2226 <member>net [rpc] conf list - Dump the complete configuration in smb.conf like
2228 <member>net [rpc] conf import - Import configuration from file in smb.conf
2230 <member>net [rpc] conf listshares - List the registry shares.</member>
2231 <member>net [rpc] conf drop - Delete the complete configuration from
2233 <member>net [rpc] conf showshare - Show the definition of a registry share.</member>
2234 <member>net [rpc] conf addshare - Create a new registry share.</member>
2235 <member>net [rpc] conf delshare - Delete a registry share.</member>
2236 <member>net [rpc] conf setparm - Store a parameter.</member>
2237 <member>net [rpc] conf getparm - Retrieve the value of a parameter.</member>
2238 <member>net [rpc] conf delparm - Delete a parameter.</member>
2239 <member>net [rpc] conf getincludes - Show the includes of a share definition.</member>
2240 <member>net [rpc] conf setincludes - Set includes for a share.</member>
2241 <member>net [rpc] conf delincludes - Delete includes from a share definition.</member>
2246 <title>[RPC] CONF LIST</title>
2249 Print the configuration data stored in the registry in a smb.conf-like format to
2255 <title>[RPC] CONF IMPORT <replaceable>[--test|-T]</replaceable> <replaceable>filename</replaceable> <replaceable>[section]</replaceable></title>
2258 This command imports configuration from a file in smb.conf format.
2259 If a section encountered in the input file is present in registry,
2260 its contents is replaced. Sections of registry configuration that have
2261 no counterpart in the input file are not affected. If you want to delete these,
2262 you will have to use the "net conf drop" or "net conf delshare" commands.
2263 Optionally, a section may be specified to restrict the effect of the
2264 import command to that specific section. A test mode is enabled by specifying
2265 the parameter "-T" on the commandline. In test mode, no changes are made to the
2266 registry, and the resulting configuration is printed to standard output instead.
2271 <title>[RPC] CONF LISTSHARES</title>
2274 List the names of the shares defined in registry.
2279 <title>[RPC] CONF DROP</title>
2282 Delete the complete configuration data from registry.
2287 <title>[RPC] CONF SHOWSHARE <replaceable>sharename</replaceable></title>
2290 Show the definition of the share or section specified. It is valid to specify
2291 "global" as sharename to retrieve the global configuration options from
2297 <title>[RPC] CONF ADDSHARE <replaceable>sharename</replaceable> <replaceable>path</replaceable> [<replaceable>writeable={y|N}</replaceable> [<replaceable>guest_ok={y|N}</replaceable> [<replaceable>comment</replaceable>]]] </title>
2299 <para>Create a new share definition in registry.
2300 The sharename and path have to be given. The share name may
2301 <emphasis>not</emphasis> be "global". Optionally, values for the very
2302 common options "writeable", "guest ok" and a "comment" may be specified.
2303 The same result may be obtained by a sequence of "net conf setparm"
2309 <title>[RPC] CONF DELSHARE <replaceable>sharename</replaceable></title>
2312 Delete a share definition from registry.
2317 <title>[RPC] CONF SETPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable> <replaceable>value</replaceable></title>
2320 Store a parameter in registry. The section may be global or a sharename.
2321 The section is created if it does not exist yet.
2326 <title>[RPC] CONF GETPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable></title>
2329 Show a parameter stored in registry.
2334 <title>[RPC] CONF DELPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable></title>
2337 Delete a parameter stored in registry.
2342 <title>[RPC] CONF GETINCLUDES <replaceable>section</replaceable></title>
2345 Get the list of includes for the provided section (global or share).
2349 Note that due to the nature of the registry database and the nature of include directives,
2350 the includes need special treatment: Parameters are stored in registry by the parameter
2351 name as valuename, so there is only ever one instance of a parameter per share.
2352 Also, a specific order like in a text file is not guaranteed. For all real
2353 parameters, this is perfectly ok, but the include directive is rather a meta
2354 parameter, for which, in the smb.conf text file, the place where it is specified
2355 between the other parameters is very important. This can not be achieved by the
2356 simple registry smbconf data model, so there is one ordered list of includes
2357 per share, and this list is evaluated after all the parameters of the share.
2361 Further note that currently, only files can be included from registry
2362 configuration. In the future, there will be the ability to include configuration
2363 data from other registry keys.
2368 <title>[RPC] CONF SETINCLUDES <replaceable>section</replaceable> [<replaceable>filename</replaceable>]+</title>
2371 Set the list of includes for the provided section (global or share) to the given
2372 list of one or more filenames. The filenames may contain the usual smb.conf
2378 <title>[RPC] CONF DELINCLUDES <replaceable>section</replaceable></title>
2381 Delete the list of includes from the provided section (global or share).
2388 <title>REGISTRY</title>
2390 Manipulate Samba's registry.
2393 <para>The registry commands are:
2395 <member>net registry enumerate - Enumerate registry keys and values.</member>
2396 <member>net registry enumerate_recursive - Enumerate registry key and its subkeys.</member>
2397 <member>net registry createkey - Create a new registry key.</member>
2398 <member>net registry deletekey - Delete a registry key.</member>
2399 <member>net registry deletekey_recursive - Delete a registry key with subkeys.</member>
2400 <member>net registry getvalue - Print a registry value.</member>
2401 <member>net registry getvalueraw - Print a registry value (raw format).</member>
2402 <member>net registry setvalue - Set a new registry value.</member>
2403 <member>net registry increment - Increment a DWORD registry value under a lock.
2405 <member>net registry deletevalue - Delete a registry value.</member>
2406 <member>net registry getsd - Get security descriptor.</member>
2407 <member>net registry getsd_sdd1 - Get security descriptor in sddl format.
2409 <member>net registry setsd_sdd1 - Set security descriptor from sddl format
2411 <member>net registry import - Import a registration entries (.reg) file.
2413 <member>net registry export - Export a registration entries (.reg) file.
2415 <member>net registry convert - Convert a registration entries (.reg) file.
2417 <member>net registry check - Check and repair a registry database.
2423 <title>REGISTRY ENUMERATE <replaceable>key</replaceable> </title>
2424 <para>Enumerate subkeys and values of <emphasis>key</emphasis>.
2429 <title>REGISTRY ENUMERATE_RECURSIVE <replaceable>key</replaceable> </title>
2430 <para>Enumerate values of <emphasis>key</emphasis> and its subkeys.
2435 <title>REGISTRY CREATEKEY <replaceable>key</replaceable> </title>
2436 <para>Create a new <emphasis>key</emphasis> if not yet existing.
2441 <title>REGISTRY DELETEKEY <replaceable>key</replaceable> </title>
2442 <para>Delete the given <emphasis>key</emphasis> and its
2443 values from the registry, if it has no subkeys.
2448 <title>REGISTRY DELETEKEY_RECURSIVE <replaceable>key</replaceable> </title>
2449 <para>Delete the given <emphasis>key</emphasis> and all of its
2450 subkeys and values from the registry.
2455 <title>REGISTRY GETVALUE <replaceable>key</replaceable> <!--
2456 --><replaceable>name</replaceable></title>
2458 <para>Output type and actual value of the value <emphasis>name</emphasis>
2459 of the given <emphasis>key</emphasis>.
2464 <title>REGISTRY GETVALUERAW <replaceable>key</replaceable> <!--
2465 --><replaceable>name</replaceable></title>
2466 <para>Output the actual value of the value <emphasis>name</emphasis>
2467 of the given <emphasis>key</emphasis>.
2472 <title>REGISTRY SETVALUE <replaceable>key</replaceable> <!--
2473 --><replaceable>name</replaceable> <replaceable>type</replaceable> <!--
2474 --><replaceable>value</replaceable> ...<!--
2477 <para>Set the value <emphasis>name</emphasis>
2478 of an existing <emphasis>key</emphasis>.
2479 <emphasis>type</emphasis> may be one of
2480 <emphasis>sz</emphasis>, <emphasis>multi_sz</emphasis> or
2481 <emphasis>dword</emphasis>.
2482 In case of <emphasis>multi_sz</emphasis> <replaceable>value</replaceable> may
2483 be given multiple times.
2488 <title>REGISTRY INCREMENT <replaceable>key</replaceable> <!--
2489 --><replaceable>name</replaceable> <replaceable>[inc]</replaceable><!--
2492 <para>Increment the DWORD value <emphasis>name</emphasis>
2493 of <emphasis>key</emphasis> by <replaceable>inc</replaceable>
2494 while holding a g_lock.
2495 <emphasis>inc</emphasis> defaults to 1.
2500 <title>REGISTRY DELETEVALUE <replaceable>key</replaceable> <!--
2501 --><replaceable>name</replaceable></title>
2503 <para>Delete the value <emphasis>name</emphasis>
2504 of the given <emphasis>key</emphasis>.
2509 <title>REGISTRY GETSD <replaceable>key</replaceable></title>
2511 <para>Get the security descriptor of the given <emphasis>key</emphasis>.
2516 <title>REGISTRY GETSD_SDDL <replaceable>key</replaceable></title>
2518 <para>Get the security descriptor of the given <emphasis>key</emphasis> as a
2519 Security Descriptor Definition Language (SDDL) string.
2524 <title>REGISTRY SETSD_SDDL <replaceable>key</replaceable><!--
2525 --><replaceable>sd</replaceable></title>
2527 <para>Set the security descriptor of the given <emphasis>key</emphasis> from a
2528 Security Descriptor Definition Language (SDDL) string <emphasis>sd</emphasis>.
2533 <title>REGISTRY IMPORT <replaceable>file</replaceable><!--
2534 --><replaceable> [--precheck <check-file>] [opt]</replaceable></title>
2535 <para>Import a registration entries (.reg) <emphasis>file</emphasis>.</para>
2536 <para>The following options are available:</para>
2538 <varlistentry><term>--precheck <replaceable>check-file</replaceable></term>
2540 This is a mechanism to check the existence or non-existence of
2541 certain keys or values specified in a precheck file before applying
2543 The import file will only be applied if the precheck succeeds.
2546 The check-file follows the normal registry file syntax with the
2547 following semantics:
2550 <listitem><para><value name>=<value> checks whether the
2551 value exists and has the given value.</para></listitem>
2552 <listitem><para><value name>=- checks whether the value does
2553 not exist.</para></listitem>
2554 <listitem><para>[key] checks whether the key exists.</para>
2556 <listitem><para>[-key] checks whether the key does not exist.</para>
2565 <title>REGISTRY EXPORT <replaceable>key</replaceable><!--
2566 --><replaceable>file</replaceable><!--
2567 --><replaceable>[opt]</replaceable></title>
2569 <para>Export a <emphasis>key</emphasis> to a registration entries (.reg)
2570 <emphasis>file</emphasis>.
2575 <title>REGISTRY CONVERT <replaceable>in</replaceable> <!--
2576 --><replaceable>out</replaceable> <!--
2577 --><replaceable>[[inopt] outopt]</replaceable></title>
2579 <para>Convert a registration entries (.reg) file <emphasis>in</emphasis>.
2584 <title>REGISTRY CHECK [-ravTl] [-o <ODB>] [--wipe] [<DB>]</title>
2585 <para>Check and repair the registry database. If no option is given a read only check of the database is done. Among others an interactive or automatic repair mode may be chosen with one of the following options
2588 <varlistentry><term>-r|--repair</term>
2590 Interactive repair mode, ask a lot of questions.
2594 <varlistentry><term>-a|--auto</term>
2596 Noninteractive repair mode, use default answers.
2600 <varlistentry><term>-v|--verbose</term>
2602 Produce more output.
2606 <varlistentry><term>-T|--test</term>
2608 Dry run, show what changes would be made but don't touch anything.
2612 <varlistentry><term>-l|--lock</term>
2614 Lock the database while doing the check.
2618 <varlistentry><term>--reg-version={1,2,3}</term>
2620 Specify the format of the registry database. If not given it defaults to
2621 the value of the binary or, if an registry.tdb is explizitly stated at
2622 the commandline, to the value found in the INFO/version record.
2626 <varlistentry><term>[--db] <DB></term>
2628 Check the specified database.
2632 <varlistentry><term>-o|--output <ODB></term>
2634 Create a new registry database <ODB> instead of modifying the
2635 input. If <ODB> is already existing --wipe may be used to
2640 <varlistentry><term>--wipe</term>
2642 Replace the registry database instead of modifying the input or
2643 overwrite an existing output database.
2647 <varlistentry><term></term>
2658 <title>EVENTLOG</title>
2660 <para>Starting with version 3.4.0 net can read, dump, import and export native
2661 win32 eventlog files (usually *.evt). evt files are used by the native Windows eventviewer tools.
2665 The import and export of evt files can only succeed when <parameter>eventlog list</parameter> is used in
2666 <emphasis>smb.conf</emphasis> file.
2667 See the <citerefentry><refentrytitle>smb.conf</refentrytitle> <manvolnum>5</manvolnum></citerefentry> manpage for details.
2670 <para>The eventlog commands are:
2672 <member>net eventlog dump - Dump a eventlog *.evt file on the screen.</member>
2673 <member>net eventlog import - Import a eventlog *.evt into the samba internal
2674 tdb based representation of eventlogs.</member>
2675 <member>net eventlog export - Export the samba internal tdb based representation
2676 of eventlogs into an eventlog *.evt file.</member>
2681 <title>EVENTLOG DUMP <replaceable>filename</replaceable></title>
2684 Prints a eventlog *.evt file to standard output.
2689 <title>EVENTLOG IMPORT <replaceable>filename</replaceable> <replaceable>eventlog</replaceable></title>
2692 Imports a eventlog *.evt file defined by <replaceable>filename</replaceable> into the
2693 samba internal tdb representation of eventlog defined by <replaceable>eventlog</replaceable>.
2694 <replaceable>eventlog</replaceable> needs to part of the <parameter>eventlog list</parameter>
2695 defined in smb.conf.
2696 See the <citerefentry><refentrytitle>smb.conf</refentrytitle> <manvolnum>5</manvolnum></citerefentry> manpage for details.
2702 <title>EVENTLOG EXPORT <replaceable>filename</replaceable> <replaceable>eventlog</replaceable></title>
2705 Exports the samba internal tdb representation of eventlog defined by <replaceable>eventlog</replaceable>
2706 to a eventlog *.evt file defined by <replaceable>filename</replaceable>.
2707 <replaceable>eventlog</replaceable> needs to part of the <parameter>eventlog list</parameter>
2708 defined in smb.conf.
2709 See the <citerefentry><refentrytitle>smb.conf</refentrytitle> <manvolnum>5</manvolnum></citerefentry> manpage for details.
2719 <para>Starting with version 3.2.0 Samba has support for remote join and unjoin APIs, both client and server-side. Windows supports remote join capabilities since Windows 2000.
2721 <para>In order for Samba to be joined or unjoined remotely an account must be used that is either member of the Domain Admins group, a member of the local Administrators group or a user that is granted the SeMachineAccountPrivilege privilege.
2724 <para>The client side support for remote join is implemented in the net dom commands which are:
2726 <member>net dom join - Join a remote computer into a domain.</member>
2727 <member>net dom unjoin - Unjoin a remote computer from a domain.</member>
2728 <member>net dom renamecomputer - Renames a remote computer joined to a domain.</member>
2733 <title>DOM JOIN <replaceable>domain=DOMAIN</replaceable> <replaceable>ou=OU</replaceable> <replaceable>account=ACCOUNT</replaceable> <replaceable>password=PASSWORD</replaceable> <replaceable>reboot</replaceable></title>
2736 Joins a computer into a domain. This command supports the following additional parameters:
2741 <listitem><para><replaceable>DOMAIN</replaceable> can be a NetBIOS domain name (also known as short domain name) or a DNS domain name for Active Directory Domains. As in Windows, it is also possible to control which Domain Controller to use. This can be achieved by appending the DC name using the \ separator character. Example: MYDOM\MYDC. The <replaceable>DOMAIN</replaceable> parameter cannot be NULL.</para></listitem>
2743 <listitem><para><replaceable>OU</replaceable> can be set to a RFC 1779 LDAP DN, like <emphasis>ou=mymachines,cn=Users,dc=example,dc=com</emphasis> in order to create the machine account in a non-default LDAP container. This optional parameter is only supported when joining Active Directory Domains.</para></listitem>
2745 <listitem><para><replaceable>ACCOUNT</replaceable> defines a domain account that will be used to join the machine to the domain. This domain account needs to have sufficient privileges to join machines.</para></listitem>
2747 <listitem><para><replaceable>PASSWORD</replaceable> defines the password for the domain account defined with <replaceable>ACCOUNT</replaceable>.</para></listitem>
2749 <listitem><para><replaceable>REBOOT</replaceable> is an optional parameter that can be set to reboot the remote machine after successful join to the domain.</para></listitem>
2754 Note that you also need to use standard net parameters to connect and authenticate to the remote machine that you want to join. These additional parameters include: -S computer and -U user.
2758 net dom join -S xp -U XP\\administrator%secret domain=MYDOM account=MYDOM\\administrator password=topsecret reboot.
2761 This example would connect to a computer named XP as the local administrator using password secret, and join the computer into a domain called MYDOM using the MYDOM domain administrator account and password topsecret. After successful join, the computer would reboot.
2767 <title>DOM UNJOIN <replaceable>account=ACCOUNT</replaceable> <replaceable>password=PASSWORD</replaceable> <replaceable>reboot</replaceable></title>
2770 Unjoins a computer from a domain. This command supports the following additional parameters:
2775 <listitem><para><replaceable>ACCOUNT</replaceable> defines a domain account that will be used to unjoin the machine from the domain. This domain account needs to have sufficient privileges to unjoin machines.</para></listitem>
2777 <listitem><para><replaceable>PASSWORD</replaceable> defines the password for the domain account defined with <replaceable>ACCOUNT</replaceable>.</para></listitem>
2779 <listitem><para><replaceable>REBOOT</replaceable> is an optional parameter that can be set to reboot the remote machine after successful unjoin from the domain.</para></listitem>
2784 Note that you also need to use standard net parameters to connect and authenticate to the remote machine that you want to unjoin. These additional parameters include: -S computer and -U user.
2788 net dom unjoin -S xp -U XP\\administrator%secret account=MYDOM\\administrator password=topsecret reboot.
2791 This example would connect to a computer named XP as the local administrator using password secret, and unjoin the computer from the domain using the MYDOM domain administrator account and password topsecret. After successful unjoin, the computer would reboot.
2797 <title>DOM RENAMECOMPUTER <replaceable>newname=NEWNAME</replaceable> <replaceable>account=ACCOUNT</replaceable> <replaceable>password=PASSWORD</replaceable> <replaceable>reboot</replaceable></title>
2800 Renames a computer that is joined to a domain. This command supports the following additional parameters:
2805 <listitem><para><replaceable>NEWNAME</replaceable> defines the new name of the machine in the domain.</para></listitem>
2807 <listitem><para><replaceable>ACCOUNT</replaceable> defines a domain account that will be used to rename the machine in the domain. This domain account needs to have sufficient privileges to rename machines.</para></listitem>
2809 <listitem><para><replaceable>PASSWORD</replaceable> defines the password for the domain account defined with <replaceable>ACCOUNT</replaceable>.</para></listitem>
2811 <listitem><para><replaceable>REBOOT</replaceable> is an optional parameter that can be set to reboot the remote machine after successful rename in the domain.</para></listitem>
2816 Note that you also need to use standard net parameters to connect and authenticate to the remote machine that you want to rename in the domain. These additional parameters include: -S computer and -U user.
2820 net dom renamecomputer -S xp -U XP\\administrator%secret newname=XPNEW account=MYDOM\\administrator password=topsecret reboot.
2823 This example would connect to a computer named XP as the local administrator using password secret, and rename the joined computer to XPNEW using the MYDOM domain administrator account and password topsecret. After successful rename, the computer would reboot.
2831 <title>G_LOCK</title>
2833 <para>Manage global locks.</para>
2836 <title>G_LOCK DO <replaceable>lockname</replaceable> <replaceable>timeout</replaceable> <replaceable>command</replaceable></title>
2839 Execute a shell command under a global lock. This might be useful to define the
2840 order in which several shell commands will be executed. The locking information
2841 is stored in a file called <filename>g_lock.tdb</filename>. In setups with CTDB
2842 running, the locking information will be available on all cluster nodes.
2846 <listitem><para><replaceable>LOCKNAME</replaceable> defines the name of the global lock.</para></listitem>
2847 <listitem><para><replaceable>TIMEOUT</replaceable> defines the timeout.</para></listitem>
2848 <listitem><para><replaceable>COMMAND</replaceable> defines the shell command to execute.</para></listitem>
2853 <title>G_LOCK LOCKS</title>
2856 Print a list of all currently existing locknames.
2861 <title>G_LOCK DUMP <replaceable>lockname</replaceable></title>
2864 Dump the locking table of a certain global lock.
2873 <para>Print information from tdb records.</para>
2876 <title>TDB LOCKING <replaceable>key</replaceable> [DUMP]</title>
2878 <para>List sharename, filename and number of share modes
2879 for a record from locking.tdb. With the optional DUMP options,
2880 dump the complete record.</para>
2884 <para><replaceable>KEY</replaceable>
2885 Key of the tdb record as hex string.</para>
2893 <title>HELP [COMMAND]</title>
2895 <para>Gives usage information for the specified command.</para>
2902 <title>VERSION</title>
2904 <para>This man page is complete for version 3 of the Samba
2909 <title>AUTHOR</title>
2911 <para>The original Samba software and related utilities
2912 were created by Andrew Tridgell. Samba is now developed
2913 by the Samba Team as an Open Source project similar
2914 to the way the Linux kernel is developed.</para>
2916 <para>The net manpage was written by Jelmer Vernooij.</para>