SAMBA-TOOL(8)

NAME
samba-tool - Main Samba administration tool.

SYNOPSIS
    .HP u
        samba-tool
         [-h]
         [-W myworkgroup]
         [-U user]
         [-d debuglevel]
         [-V]

DESCRIPTION

    .PP This tool is part of the samba(7) suite.

OPTIONS

    .PP Samba-tool consists of many sub-commands, each of which have their own set of options. The options listed in this section are common across several sub-commands.

    .PP -h|--help

        Show a help message and exit.
        .RE

    -r|--realm=REALM

                Set the realm for the domain.

                Note that specifying this parameter here will override the realm parameter in the /etc/samba/smb.conf file.

    --simple-bind-dn=DN

                DN to use for a simple bind.

    --password

                Specify the password on the commandline.

                Be cautious about including passwords in scripts or passing user-supplied values onto the command line. For security it is better to let the Samba client tool ask for the password if needed, or obtain the password once with kinit.

                If --password is not specified, the tool will check the PASSWD environment variable, followed by PASSWD_FD which is expected to contain an open file descriptor (FD) number.

                Finally it will check PASSWD_FILE (containing a file path to be opened). The file should only contain the password. Make certain that the permissions on the file restrict access from unwanted users!

                While Samba will attempt to scrub the password from the process title (as seen in ps), this is after startup and so is subject to a race.

    -U|--user=[DOMAIN\]USERNAME[%PASSWORD]

                Sets the SMB username or username and password.

                If %PASSWORD is not specified, the user will be prompted. The client will first check the USER environment variable (which is also permitted to also contain the password separated by a %), then the LOGNAME variable (which is not permitted to contain a password) and if either exists, the value is used. If these environmental variables are not found, the username found in a Kerberos Credentials cache may be used.

                A third option is to use a credentials file which contains the plaintext of the username and password. This option is mainly provided for scripts where the admin does not wish to pass the credentials on the command line or via environment variables. If this method is used, make certain that the permissions on the file restrict access from unwanted users. See the -A for more details.

                Be cautious about including passwords in scripts or passing user-supplied values onto the command line. For security it is better to let the Samba client tool ask for the password if needed, or obtain the password once with kinit.

                While Samba will attempt to scrub the password from the process title (as seen in ps), this is after startup and so is subject to a race.

    -W|--workgroup=WORKGROUP

                Set the SMB domain of the username. This overrides the default domain which is the domain defined in smb.conf. If the domain specified is the same as the servers NetBIOS name, it causes the client to log on using the servers local SAM (as opposed to the Domain SAM).

                Note that specifying this parameter here will override the workgroup parameter in the /etc/samba/smb.conf file.

    -N|--no-pass

                If specified, this parameter suppresses the normal password prompt from the client to the user. This is useful when accessing a service that does not require a password.

                Unless a password is specified on the command line or this parameter is specified, the client will request a password.

                If a password is specified on the command line and this option is also defined the password on the command line will be silently ignored and no password will be used.

    --use-kerberos=desired|required|off

                This parameter determines whether Samba client tools will try to authenticate using Kerberos. For Kerberos authentication you should use DNS names instead of IP addresses when connecting to a service. By default Samba client tools will try to use the default Kerberos credential cache (ccache). In case the ccache does not exist or -U|--user option was specified, clients will ask to enter a password and will obtain a Kerberos ticket (kinit) for you. If you want to use an alternative Kerberos credentical cache, use the --use-krb5-ccache option.

                Note that specifying this parameter here will override the client use kerberos parameter in the /etc/samba/smb.conf file.

    --use-krb5-ccache=CCACHE

                Specifies the credential cache location for Kerberos authentication.

                This will enforce --use-kerberos=required.

    -A|--authentication-file=filename

                This option allows you to specify a file from which to read the username and password used in the connection. The format of the file is:

            				username = <value>
            				password = <value>
            				domain   = <value>

                Make certain that the permissions on the file restrict access from unwanted users!

        .PP -H URL, --URL=URL

                LDB URL for database or target server.

                The URL can either be a plain file path, or use one of the schemes listed here. If a plain path is used, it is treated as if 'tdb://' was used.
                  .PP tdb://PATH

                      PATH is the location of a TDB database.

                      .RE
                      .PP mdb://PATH

                          PATH is the location of an LMDB database.

                          .RE
                          .PP ldb://PATH

                              PATH is the location of an LDB database, in either LMDB or TDB format. The formats will be tried one after another until one succeeds or all fail. It is safe to use this if you don't know the format of the file.

                              .RE
                              .PP ldap://HOSTNAME, ldaps://HOSTNAME

                                  The LDB backend is the named ldap server. ldaps:// wraps the connection in TLS.

                                  .RE
                                  .PP ldapi://SOCKET

                                      The backend server is a local ldap server using a unix domain socket.

                                      .RE
                                    .sp

                                .RE
                                .PP --color=always|never|auto

                                      use colour if available (default: auto)
                                    .RE
                                    .PP --ipaddress=IPADDRESS

                                        IP address of the server
                                        .RE
                                        .PP -s FILE, --configfile=FILE

                                              Use this smb.conf configuration file.
                                            .RE
                                            .PP --color=always|never|auto

                                                      Indicate whether samba-tool should use ANSI colour codes in its output. If 'auto' (the default), samba-tool will use colour when its output is directed toward a terminal, unless the NO_COLOR environment variable is set and non-empty.

                                                      The values 'yes' and 'force' are accepted as synonyms for 'always'; 'no' and 'none' for 'never'; and 'tty' and 'if-tty' for 'auto'.

                                                      Note that asking for colour doesn't mean samba-tool will necessarily be very colourful. Many commands are very monochrome, particularly when successful.

                                                .RE
                                                .PP -V, --version

                                                      Display the version number and exit.
                                                    .RE

                                                -d|--debuglevel=level

                                                            level is an integer from 0 to 10. The default value if this parameter is not specified is 1 for client applications.

                                                            The higher this value, the more detail will be logged to the log files about the activities of the server. At level 0, only critical errors and serious warnings will be logged. Level 1 is a reasonable level for day-to-day running - it generates a small amount of information about operations carried out.

                                                            Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic.

                                                            Note that specifying this parameter here will override the log level parameter in the /etc/samba/smb.conf file.

                                                --debug-stdout

                                                            This will redirect debug output to STDOUT. By default all clients are logging to STDERR.

COMMANDS

  computer

    .PP Manage computer accounts.

computer add computername [options]

        .PP Add a new computer to the Active Directory Domain.
        .PP The new computer name specified on the command is the sAMAccountName, with or without the trailing dollar sign.

        .PP --computerou=COMPUTEROU

            DN of alternative location (with or without domainDN counterpart) to default CN=Computers in which new computer object will be created. E.g. 'OU=OUname'.
            .RE
            .PP --description=DESCRIPTION

                The new computer's description.
                .RE
                .PP --ip-address=IP_ADDRESS_LIST

                    IPv4 address for the computer's A record, or IPv6 address for AAAA record, can be provided multiple times.
                    .RE
                    .PP --service-principal-name=SERVICE_PRINCIPAL_NAME_LIST

                        Computer's Service Principal Name, can be provided multiple times.
                        .RE
                        .PP --prepare-oldjoin

                            Prepare enabled machine account for oldjoin mechanism.
                            .RE

                    computer create computername [options]

                            .PP Add a new computer. This is a synonym for the samba-tool computer add command and is available for compatibility reasons only. Please use samba-tool computer add instead.

                    computer delete computername [options]

                            .PP Delete an existing computer account.
                            .PP The computer name specified on the command is the sAMAccountName, with or without the trailing dollar sign.

                    computer edit computername

                            .PP Edit a computer AD object.
                            .PP The computer name specified on the command is the sAMAccountName, with or without the trailing dollar sign.

                            .PP --editor=EDITOR

                                Specifies the editor to use instead of the system default, or 'vi' if no system default is set.
                                .RE

                        computer list

                                .PP List all computers.

                        computer move computername new_parent_dn [options]

                                .PP This command moves a computer account into the specified organizational unit or container.
                                .PP The computername specified on the command is the sAMAccountName, with or without the trailing dollar sign.
                                .PP The name of the organizational unit or container can be specified as a full DN or without the domainDN component.

                        computer show computername [options]

                                .PP Display a computer AD object.
                                .PP The computer name specified on the command is the sAMAccountName, with or without the trailing dollar sign.

                                .PP --attributes=USER_ATTRS

                                    Comma separated list of attributes, which will be printed.
                                    .RE

  computer keytrust

    .PP Manage Key Credential Links for a computer.
    .PP This can populate, describe or delete msDS-KeyCredentialLink attributes.

computer keytrust add computername public-key-or-certificate[options]

    Add a key-credential-link, which is a linked attribute that holds a public key in a binary field.

    The second argument is a filename that should refer to a 2048 bit RSA key (or a certificate containing that key) in PEM or DER format. By default the encoding format will be detected automatically, but you can attempt to override this with --encoding option. Other types of public key are not supported, though the --force option can be used to add a non-2048 bit key.
          .PP --link-target=DN

                link to this DN (default: the computer's DN)
              .RE
              .PP --encoding=ENCODING

                    Key format, either pem, der, or auto. The default is auto, which is likely to detect the correct format in all circumstances.
                  .RE
                  .PP --force

                        proceed with operations that seems ill-fated
                      .RE

            computer keytrust delete computername [options]

                Delete a key-credential-link.

                The link to be deleted can be selected in a number of ways. --all will delete all key credential links for the computer (often there will only be one). The --link-target option selects a key credential link based on the DN targeted by the link. The --fingerprint option selects a link to delete based on the key fingerprint. This is the SHA256 of the DER-encoded key material, expressed as hex-pairs separated by colons. See computer keytrust view to get a list of links and their fingerprints.

                If more than one of --link-target, --fingerprint, and --all are used, links matched by any of them will be deleted.

                The --dry-run option will prevent links from being deleted, and instead indicate what would happen if it was omitted.
                      .PP --link-target=DN

                            Delete this key credential link (a DN)
                          .RE
                          .PP --fingerprint=HH:HH:..

                                Delete the key credential link with this key fingerprint
                              .RE
                              .PP --all

                                    Delete all key credential links
                                  .RE
                                  .PP -n, --dry-run

                                        Do nothing but print what would happen
                                      .RE

                            computer keytrust view computername [options]

                                View a computer's key credential links. This can be used to find a link's fingerprint and target DN for . The --verbose includes more, probably useless, information.
                                      .PP -h, --help

                                            show this help message and exit
                                          .RE
                                          .PP -v, --verbose

                                                Be verbose
                                              .RE

                                    computer generate-csr computername subject_name private_key_filename output_filename [options]

                                            .PP Generate a PEMâencoded Certificate Signing Request for a computer.

                                              .PP --private-key-encoding

                                                    Specify which encoding the private key uses. Default is 'auto'.
                                                  .RE
                                                  .PP --private-key-pass

                                                        Provide a password to decrypt the private key.
                                                      .RE

  contact

    .PP Manage contacts.

contact add [contactname] [options]

        .PP Add a new contact to the Active Directory Domain.
        .PP The name of the new contact can be specified by the first argument 'contactname' or the --given-name, --initial and --surname arguments. If no 'contactname' is given, contact's name will be made up of the given arguments by combining the given-name, initials and surname. Each argument is optional. A dot ('.') will be appended to the initials automatically.

        .PP --ou=OU

            DN of alternative location (with or without domainDN counterpart) in which the new contact will be created. E.g. 'OU=OUname'. Default is the domain base.
            .RE
            .PP --description=DESCRIPTION

                The new contact's description.
                .RE
                .PP --surname=SURNAME

                    Contact's surname.
                    .RE
                    .PP --given-name=GIVEN_NAME

                        Contact's given name.
                        .RE
                        .PP --initials=INITIALS

                            Contact's initials.
                            .RE
                            .PP --display-name=DISPLAY_NAME

                                Contact's display name.
                                .RE
                                .PP --job-title=JOB_TITLE

                                    Contact's job title.
                                    .RE
                                    .PP --department=DEPARTMENT

                                        Contact's department.
                                        .RE
                                        .PP --company=COMPANY

                                            Contact's company.
                                            .RE
                                            .PP --mail-address=MAIL_ADDRESS

                                                Contact's email address.
                                                .RE
                                                .PP --internet-address=INTERNET_ADDRESS

                                                    Contact's home page.
                                                    .RE
                                                    .PP --telephone-number=TELEPHONE_NUMBER

                                                        Contact's phone number.
                                                        .RE
                                                        .PP --mobile-number=MOBILE_NUMBER

                                                            Contact's mobile phone number.
                                                            .RE
                                                            .PP --physical-delivery-office=PHYSICAL_DELIVERY_OFFICE

                                                                Contact's office location.
                                                                .RE

                                                        contact create [contactname] [options]

                                                                .PP Add a new contact. This is a synonym for the samba-tool contact add command and is available for compatibility reasons only. Please use samba-tool contact add instead.

                                                        contact delete contactname [options]

                                                                .PP Delete an existing contact.
                                                                .PP The contactname specified on the command is the common name or the distinguished name of the contact object. The distinguished name of the contact can be specified with or without the domainDN component.

                                                        contact edit contactname

                                                                .PP Modify a contact AD object.
                                                                .PP The contactname specified on the command is the common name or the distinguished name of the contact object. The distinguished name of the contact can be specified with or without the domainDN component.

                                                                .PP --editor=EDITOR

                                                                    Specifies the editor to use instead of the system default, or 'vi' if no system default is set.
                                                                    .RE

                                                            contact list [options]

                                                                    .PP List all contacts.

                                                                    .PP --full-dn

                                                                        Display contact's full DN instead of the name.
                                                                        .RE

                                                                contact move contactname new_parent_dn [options]

                                                                        .PP This command moves a contact into the specified organizational unit or container.
                                                                        .PP The contactname specified on the command is the common name or the distinguished name of the contact object. The distinguished name of the contact can be specified with or without the domainDN component.

                                                                contact show contactname [options]

                                                                        .PP Display a contact AD object.
                                                                        .PP The contactname specified on the command is the common name or the distinguished name of the contact object. The distinguished name of the contact can be specified with or without the domainDN component.

                                                                        .PP --attributes=CONTACT_ATTRS

                                                                            Comma separated list of attributes, which will be printed.
                                                                            .RE

                                                                    contact rename contactname [options]

                                                                            .PP Rename a contact and related attributes.
                                                                            .PP This command allows to set the contact's name related attributes. The contact's CN will be renamed automatically. The contact's new CN will be made up by combining the given-name, initials and surname. A dot ('.') will be appended to the initials automatically, if required. Use the --force-new-cn option to specify the new CN manually and --reset-cn to reset this change.
                                                                            .PP Use an empty attribute value to remove the specified attribute.
                                                                            .PP The contact name specified on the command is the CN.

                                                                            .PP --surname=SURNAME

                                                                                New surname.
                                                                                .RE
                                                                                .PP --given-name=GIVEN_NAME

                                                                                    New given name.
                                                                                    .RE
                                                                                    .PP --initials=INITIALS

                                                                                        New initials.
                                                                                        .RE
                                                                                        .PP --force-new-cn=NEW_CN

                                                                                            Specify a new CN (RDN) instead of using a combination of the given name, initials and surname.
                                                                                            .RE
                                                                                            .PP --reset-cn

                                                                                                Set the CN to the default combination of given name, initials and surname.
                                                                                                .RE
                                                                                                .PP --display-name=DISPLAY_NAME

                                                                                                    New display name.
                                                                                                    .RE
                                                                                                    .PP --mail-address=MAIL_ADDRESS

                                                                                                        New email address.
                                                                                                        .RE

  dbcheck

    .PP Check the local AD database for errors.

  delegation

    .PP Manage Delegations.

delegation add-principal accountname principal [options]

        .PP Add a principal to msDS-AllowedToActOnBehalfOfOtherIdentity that may delegate to an account.

delegation del-principal accountname principal [options]

        .PP Delete a principal from msDS-AllowedToActOnBehalfOfOtherIdentity so that it may no longer delegate to an account.

delegation add-service accountname principal [options]

        .PP Add a service principal as msDS-AllowedToDelegateTo.

delegation del-service accountname principal [options]

        .PP Delete a service principal as msDS-AllowedToDelegateTo.

delegation for-any-protocol accountname [(on|off)] [options]

        .PP Set/unset UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION (S4U2Proxy) for an account.

delegation for-any-service accountname [(on|off)] [options]

        .PP Set/unset UF_TRUSTED_FOR_DELEGATION for an account.

delegation show accountname [options]

        .PP Show the delegation setting of an account.

  dns

    .PP Manage Domain Name Service (DNS).

dns add server zone name A|AAAA|PTR|CNAME|NS|MX|SRV|TXT data

        .PP Add a DNS record.

        .PP --allow-existing

            Do not treat an existing record of this name and type as an error. This has no functional change (the new DNS record is not added) but the message and samba-tool return code will not indicate error.
            .RE

    dns cleanup server name

            .PP Clean up DNS records for a host, so that DNS queries no longer return results. Usually this works by marking the records as deleted in the database.
            .PP Example: samba-tool dns cleanup dc1 computer.samdom.test.site

    dns delete server zone name A|AAAA|PTR|CNAME|NS|MX|SRV|TXT data

            .PP Delete a DNS record.

    dns query server zone name A|AAAA|PTR|CNAME|NS|MX|SRV|TXT|ALL [options] data

            .PP Query a name.

    dns roothints server [name] [options]

            .PP Query root hints.

    dns serverinfo server [options]

            .PP Query server information.

    dns update server zone name A|AAAA|PTR|CNAME|NS|MX|SRV|TXT olddata newdata

            .PP Update a DNS record.

    dns zonecreate server zone [options]

            .PP Create a zone.

    dns zonedelete server zone [options]

            .PP Delete a zone.

    dns zoneinfo server zone [options]

            .PP Query zone information.

    dns zonelist server [options]

            .PP List zones.

    dns zoneoptions server zone [options]

            .PP Manipulate aging options. This is useful in zones using dynamic DNS.
            .PP There are options to change records from static to dynamic based on regular expressions or age, which is useful in some cases where the values got mixed up in old versions of Samba.

                .PP -n, --dry-run

                        Do not actually change anything, but show what would happen.
                    .RE
                    .PP --client-version=w2k|dotnet|longhorn

                            Windows client protocol version. The default is longhorn, which is probably what you want.

                        .RE
                        .PP --mark-old-records-static=YYYY-MM-DD

                                Mark records older than the specified date as static.
                            .RE
                            .PP --mark-records-static-regex=REGEXP

                                    Mark records that match the given perl-compatible regular expression as static.
                                .RE
                                .PP --mark-records-dynamic-regex=REGEXP

                                        Mark records that match the given perl-compatible regular expression as dynamic.
                                    .RE
                                    .PP --aging=0|1

                                              --aging=1 to enable aging for this zone.

                                            --aging=0 to disable aging for this zone.
                                        .RE
                                        .PP --norefreshinterval=HOURS

                                                avoid further refreshes for this long after a dynamic update. Set to zero to use the default.
                                            .RE
                                            .PP --refreshinterval=HOURS

                                                  Dynamic refresh interval in hours (0: use default)
                                                .RE
                                                .PP

                                                    .RE

  domain

    .PP Manage Domain.

domain backup

        .PP Create or restore a backup of the domain.

domain backup offline

        .PP Backup (with proper locking) local domain directories into a tar file.

domain backup online

        .PP Copy a running DC's current DB into a backup tar file.

domain backup rename

        .PP Copy a running DC's DB to backup file, renaming the domain in the process.

domain backup restore

        .PP Restore the domain's DB from a backup-file.

  domain auth policy

    .PP Manage authentication policies.

domain auth policy list

        .PP List authentication policies on the domain.

            .PP -H, --URL

                    LDB URL for database or target server.
                .RE
                .PP --json

                        View authentication policies as JSON instead of a list.
                    .RE

        domain auth policy view

                .PP View an authentication policy on the domain.

                    .PP -H, --URL

                            LDB URL for database or target server.
                        .RE
                        .PP --name

                                Name of the authentication policy to view (required).
                            .RE

                domain auth policy create

                        .PP Create authentication policies on the domain.

                            .PP -H, --URL

                                    LDB URL for database or target server.
                                .RE
                                .PP --name

                                        Name of the authentication policy (required).
                                    .RE
                                    .PP --description

                                            Optional description for the authentication policy.
                                        .RE
                                        .PP --protect

                                                    Protect authentication policy from accidental deletion.

                                                    Cannot be used together with --unprotect.

                                            .RE
                                            .PP --unprotect

                                                        Unprotect authentication policy from accidental deletion.

                                                        Cannot be used together with --protect.

                                                .RE
                                                .PP --audit

                                                            Only audit authentication policy.

                                                            Cannot be used together with --enforce.

                                                    .RE
                                                    .PP --enforce

                                                                Enforce authentication policy.

                                                                Cannot be used together with --audit.

                                                        .RE
                                                        .PP --strong-ntlm-policy

                                                                    Strong NTLM Policy (Disabled, Optional, Required).

                                                            .RE
                                                            .PP --user-tgt-lifetime-mins

                                                                        Ticket-Granting-Ticket lifetime for user accounts.

                                                                .RE
                                                                .PP --user-allow-ntlm-auth

                                                                            Allow NTLM and Interactive NETLOGON SamLogon authentication despite the fact that allowed-to-authenticate-from is in use, which would otherwise restrict the user to selected devices.

                                                                    .RE
                                                                    .PP --user-allowed-to-authenticate-from

                                                                                Conditions a device must meet for users covered by this policy to be allowed to authenticate. While this is a restriction on the device, any conditional ACE rules are expressed as if the device was a user.

                                                                                Must be a valid SDDL string without reference to Device keywords.

                                                                                Example: O:SYG:SYD:(XA;OICI;CR;;;WD;(Member_of {SID(AU)}))

                                                                        .RE
                                                                        .PP --user-allowed-to-authenticate-to=SDDL

                                                                                    This policy, applying to a user account that is offering a service, eg a web server with a user account, restricts which accounts may access it.

                                                                                    Must be a valid SDDL string. The SDDL can reference both bare (user) and Device conditions.

                                                                                    SDDL Example: O:SYG:SYD:(XA;OICI;CR;;;WD;(Member_of {SID(AO)}))

                                                                            .RE
                                                                            .PP --service-tgt-lifetime-mins

                                                                                        Ticket-Granting-Ticket lifetime for service accounts.

                                                                                .RE
                                                                                .PP --service-allow-ntlm-auth

                                                                                            Allow NTLM network authentication when service is restricted to selected devices.

                                                                                    .RE
                                                                                    .PP --service-allowed-to-authenticate-from

                                                                                                Conditions a device must meet for service accounts covered by this policy to be allowed to authenticate. While this is a restriction on the device, any conditional ACE rules are expressed as if the device was a user.

                                                                                                Must be a valid SDDL string without reference to Device keywords.

                                                                                                SDDL Example: O:SYG:SYD:(XA;OICI;CR;;;WD;(Member_of {SID(AU)}))

                                                                                        .RE
                                                                                        .PP --service-allowed-to-authenticate-to=SDDL

                                                                                                    This policy, applying to a service account (eg a Managed Service Account, Group Managed Service Account), restricts which accounts may access it.

                                                                                                    Must be a valid SDDL string. The SDDL can reference both bare (user) and Device conditions.

                                                                                                    SDDL Example: O:SYG:SYD:(XA;OICI;CR;;;WD;(Member_of {SID(AO)}))

                                                                                            .RE
                                                                                            .PP --computer-tgt-lifetime-mins

                                                                                                        Ticket-Granting-Ticket lifetime for computer accounts.

                                                                                                .RE
                                                                                                .PP --computer-allowed-to-authenticate-to=SDDL

                                                                                                            This policy, applying to a computer account (eg a server or workstation), restricts which accounts may access it.

                                                                                                            Must be a valid SDDL string. The SDDL can reference both bare (user) and Device conditions.

                                                                                                            SDDL Example: O:SYG:SYD:(XA;OICI;CR;;;WD;(Member_of {SID(AO)}))

                                                                                                    .RE

                                                                                        domain auth policy modify

                                                                                                .PP Modify authentication policies on the domain. The same options apply as for domain auth policy create.

                                                                                        domain auth policy delete

                                                                                                .PP Delete authentication policies on the domain.

                                                                                                    .PP -H, --URL

                                                                                                            LDB URL for database or target server.
                                                                                                        .RE
                                                                                                        .PP --name

                                                                                                                Name of authentication policy to delete (required).
                                                                                                            .RE
                                                                                                            .PP --force

                                                                                                                    Force authentication policy delete even if it is protected.
                                                                                                                .RE

                                                                                                    domain auth policy user-allowed-to-authenticate-from set

                                                                                                            .PP Set the user-allowed-to-authenticate-from property by scenario.

                                                                                                                .PP -H, --URL

                                                                                                                        LDB URL for database or target server.
                                                                                                                    .RE
                                                                                                                    .PP --name

                                                                                                                            Name of authentication policy.
                                                                                                                        .RE
                                                                                                                        .PP --by-group=GROUP

                                                                                                                                User is allowed to authenticate, if the device they authenticate from is assigned and granted membership of a given GROUP.
                                                                                                                            .RE
                                                                                                                            .PP --silo=SILO

                                                                                                                                    User is allowed to authenticate, if the device they authenticate from is assigned and granted membership of a given SILO.
                                                                                                                                .RE

                                                                                                                    domain auth policy user-allowed-to-authenticate-to set

                                                                                                                            .PP Set the user-allowed-to-authenticate-to property by scenario.

                                                                                                                                .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --name

                                                                                                                                        Name of authentication policy.
                                                                                                                                    .RE
                                                                                                                                    .PP --group=GROUP

                                                                                                                                        The user account, offering a network service, covered by this policy, will only be allowed access from other accounts that are members of the given GROUP.
                                                                                                                                    .RE
                                                                                                                                    .PP --silo=SILO

                                                                                                                                        The user account, offering a network service, covered by this policy, will only be allowed access from other accounts that are assigned to, granted membership of (and meet any authentication conditions of) the given SILO.
                                                                                                                                    .RE

                                                                                                                        domain auth policy service-allowed-to-authenticate-from set

                                                                                                                                .PP Set the service-allowed-to-authenticate-from property by scenario.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --name

                                                                                                                                        Name of authentication policy.
                                                                                                                                    .RE
                                                                                                                                    .PP --group=GROUP

                                                                                                                                        The service account (eg a Managed Service Account, Group Managed Service Account) is allowed to authenticate, if the device it authenticates from is a member of the given GROUP.
                                                                                                                                    .RE
                                                                                                                                    .PP --silo=SILO

                                                                                                                                        The service account (eg a Managed Service Account, Group Managed Service Account) is allowed to authenticate, if the device it authenticates from is assigned and granted membership of a given SILO.
                                                                                                                                    .RE

                                                                                                                        domain auth policy service-allowed-to-authenticate-to set

                                                                                                                                .PP Set the service-allowed-to-authenticate-to property by scenario.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --name

                                                                                                                                        Name of authentication policy.
                                                                                                                                    .RE
                                                                                                                                    .PP --group=GROUP

                                                                                                                                        The service account (eg a Managed Service Account, Group Managed Service Account), will only be allowed access by other accounts that are members of the given GROUP.
                                                                                                                                    .RE
                                                                                                                                    .PP --silo=SILO

                                                                                                                                        The service account (eg a Managed Service Account, Group Managed Service Account), will only be allowed access by other accounts that are assigned to, granted membership of (and meet any authentication conditions of) the given SILO.
                                                                                                                                    .RE

                                                                                                                        domain auth policy computer-allowed-to-authenticate-to set

                                                                                                                                .PP Set the computer-allowed-to-authenticate-to property by scenario.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --name

                                                                                                                                        Name of authentication policy.
                                                                                                                                    .RE
                                                                                                                                    .PP --group=GROUP

                                                                                                                                        The computer account (eg a server or workstation), will only be allowed access by other accounts that are members of the given GROUP.
                                                                                                                                    .RE
                                                                                                                                    .PP --silo=SILO

                                                                                                                                        The computer account (eg a server or workstation), will only be allowed access by other accounts that are assigned to, granted membership of (and meet any authentication conditions of) the given SILO.
                                                                                                                                    .RE

  domain auth silo

    .PP Manage authentication silos.

domain auth silo list

        .PP List authentication silos on the domain.

            .PP -H, --URL

                    LDB URL for database or target server.
                .RE
                .PP --json

                        View authentication silos as JSON instead of a list.
                    .RE

        domain auth silo view

                .PP View an authentication silo on the domain.

                    .PP -H, --URL

                            LDB URL for database or target server.
                        .RE
                        .PP --name

                                Name of the authentication silo to view (required).
                            .RE

                domain auth silo create

                        .PP Create authentication silos on the domain.

                            .PP -H, --URL

                                    LDB URL for database or target server.
                                .RE
                                .PP --name

                                        Name of the authentication silo (required).
                                    .RE
                                    .PP --description

                                            Optional description for the authentication silo.
                                        .RE
                                        .PP --user-authentication-policy

                                                User account authentication policy.
                                            .RE
                                            .PP --service-authentication-policy

                                                    Managed service account authentication policy.
                                                .RE
                                                .PP --computer-authentication-policy

                                                        Computer authentication policy.
                                                    .RE
                                                    .PP --protect

                                                                Protect authentication silo from accidental deletion.

                                                                Cannot be used together with --unprotect.

                                                        .RE
                                                        .PP --unprotect

                                                                    Unprotect authentication silo from accidental deletion.

                                                                    Cannot be used together with --protect.

                                                            .RE
                                                            .PP --audit

                                                                        Only audit silo policies.

                                                                        Cannot be used together with --enforce.

                                                                .RE
                                                                .PP --enforce

                                                                            Enforce silo policies.

                                                                            Cannot be used together with --audit.

                                                                    .RE

                                                        domain auth silo modify

                                                                .PP Modify authentication silos on the domain.

                                                                    .PP -H, --URL

                                                                            LDB URL for database or target server.
                                                                        .RE
                                                                        .PP --name

                                                                                Name of the authentication silo (required).
                                                                            .RE
                                                                            .PP --description

                                                                                    Optional description for the authentication silo.
                                                                                .RE
                                                                                .PP --user-authentication-policy

                                                                                        User account authentication policy.
                                                                                    .RE
                                                                                    .PP --service-authentication-policy

                                                                                            Managed service account authentication policy.
                                                                                        .RE
                                                                                        .PP --computer-authentication-policy

                                                                                                Computer authentication policy.
                                                                                            .RE
                                                                                            .PP --protect

                                                                                                        Protect authentication silo from accidental deletion.

                                                                                                        Cannot be used together with --unprotect.

                                                                                                .RE
                                                                                                .PP --unprotect

                                                                                                            Unprotect authentication silo from accidental deletion.

                                                                                                            Cannot be used together with --protect.

                                                                                                    .RE
                                                                                                    .PP --audit

                                                                                                                Only audit silo policies.

                                                                                                                Cannot be used together with --enforce.

                                                                                                        .RE
                                                                                                        .PP --enforce

                                                                                                                    Enforce silo policies.

                                                                                                                    Cannot be used together with --audit.

                                                                                                            .RE

                                                                                                domain auth silo delete

                                                                                                        .PP Delete authentication silos on the domain.

                                                                                                            .PP -H, --URL

                                                                                                                    LDB URL for database or target server.
                                                                                                                .RE
                                                                                                                .PP --name

                                                                                                                        Name of authentication silo to delete (required).
                                                                                                                    .RE
                                                                                                                    .PP --force

                                                                                                                            Force authentication silo delete even if it is protected.
                                                                                                                        .RE

                                                                                                            domain auth silo member grant

                                                                                                                    .PP Grant a member access to an authentication silo.

                                                                                                                        .PP -H, --URL

                                                                                                                                LDB URL for database or target server.
                                                                                                                            .RE
                                                                                                                            .PP --name

                                                                                                                                    Name of authentication silo (required).
                                                                                                                                .RE
                                                                                                                                .PP --member

                                                                                                                                        Member to grant access to the silo (DN or account name).
                                                                                                                                    .RE

                                                                                                                        domain auth silo member list

                                                                                                                                .PP List members in an authentication silo.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --name

                                                                                                                                        Name of authentication silo (required).
                                                                                                                                    .RE
                                                                                                                                    .PP --json

                                                                                                                                        View members as JSON instead of a list.
                                                                                                                                    .RE

                                                                                                                        domain auth silo member revoke

                                                                                                                                .PP Revoke a member from an authentication silo.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --name

                                                                                                                                        Name of authentication silo (required).
                                                                                                                                    .RE
                                                                                                                                    .PP --member

                                                                                                                                        Member to revoke from the silo (DN or account name).
                                                                                                                                    .RE

                                                                                                                        domain claim claim-type list

                                                                                                                                .PP List claim types on the domain.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --json

                                                                                                                                        View claim types as JSON instead of a list.
                                                                                                                                    .RE

                                                                                                                        domain claim claim-type view

                                                                                                                                .PP View a single claim type on the domain.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --name

                                                                                                                                        Display name of claim type to view (required).
                                                                                                                                    .RE

                                                                                                                        domain claim claim-type create

                                                                                                                                .PP Create claim types on the domain.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --attribute

                                                                                                                                        Attribute of claim type to create (required).
                                                                                                                                    .RE
                                                                                                                                    .PP --class

                                                                                                                                            Object classes to set claim type to.

                                                                                                                                            Example: --class=user --class=computer

                                                                                                                                    .RE
                                                                                                                                    .PP --name

                                                                                                                                        Optional display name or use attribute name.
                                                                                                                                    .RE
                                                                                                                                    .PP --description

                                                                                                                                        Optional description or use from attribute.
                                                                                                                                    .RE
                                                                                                                                    .PP --enable

                                                                                                                                            Enable claim type.

                                                                                                                                            Cannot be used together with --disable.

                                                                                                                                    .RE
                                                                                                                                    .PP --disable

                                                                                                                                            Disable claim type.

                                                                                                                                            Cannot be used together with --enable.

                                                                                                                                    .RE
                                                                                                                                    .PP --protect

                                                                                                                                            Protect claim type from accidental deletion.

                                                                                                                                            Cannot be used together with --unprotect.

                                                                                                                                    .RE
                                                                                                                                    .PP --unprotect

                                                                                                                                            Unprotect claim type from accidental deletion.

                                                                                                                                            Cannot be used together with --protect.

                                                                                                                                    .RE

                                                                                                                        domain claim claim-type modify

                                                                                                                                .PP Modify claim types on the domain.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --name

                                                                                                                                        Display name of claim type to modify (required).
                                                                                                                                    .RE
                                                                                                                                    .PP --class

                                                                                                                                            Object classes to set claim type to.

                                                                                                                                            Example: --class=user --class=computer

                                                                                                                                    .RE
                                                                                                                                    .PP --description

                                                                                                                                        Set the claim type description.
                                                                                                                                    .RE
                                                                                                                                    .PP --enable

                                                                                                                                            Enable claim type.

                                                                                                                                            Cannot be used together with --disable.

                                                                                                                                    .RE
                                                                                                                                    .PP --disable

                                                                                                                                            Disable claim type.

                                                                                                                                            Cannot be used together with --enable.

                                                                                                                                    .RE
                                                                                                                                    .PP --protect

                                                                                                                                            Protect claim type from accidental deletion.

                                                                                                                                            Cannot be used together with --unprotect.

                                                                                                                                    .RE
                                                                                                                                    .PP --unprotect

                                                                                                                                            Unprotect claim type from accidental deletion.

                                                                                                                                            Cannot be used together with --protect.

                                                                                                                                    .RE

                                                                                                                        domain claim claim-type delete

                                                                                                                                .PP Delete claim types on the domain.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --name

                                                                                                                                        Display name of claim type to delete (required).
                                                                                                                                    .RE
                                                                                                                                    .PP --force

                                                                                                                                        Force claim type delete even if it is protected.
                                                                                                                                    .RE

                                                                                                                        domain claim value-type list

                                                                                                                                .PP List claim value types on the domain.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --json

                                                                                                                                        View claim value types as JSON instead of a list.
                                                                                                                                    .RE

                                                                                                                        domain claim value-type view

                                                                                                                                .PP View a single claim value type on the domain.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --name

                                                                                                                                        Display name of claim value type to view (required).
                                                                                                                                    .RE

                                                                                                                        domain classicupgrade [options] classic_smb_conf

                                                                                                                                .PP Upgrade from Samba classic (NT4-like) database to Samba AD DC database.

                                                                                                                        domain dcpromo dnsdomain [DC|RODC] [options]

                                                                                                                                .PP Promote an existing domain member or NT4 PDC to an AD DC.

                                                                                                                        domain demote

                                                                                                                                .PP Demote ourselves from the role of domain controller.

                                                                                                                        domain exportkeytab keytab [options]

                                                                                                                                .PP Dumps Kerberos keys of the domain into a keytab.

                                                                                                                        domain functionalprep [options]

                                                                                                                                .PP Prepare a domain for functional level upgrade. If --functional-level is not used, the latest supported version is used (currently 2016).
                                                                                                                                .PP There are two aspects to this preparation, relating to the forest and the domain. By default both are run. If either of --forest-prep or --domain-prep are used, only the corresponding preparation is made. If both arguments are used together, all preparation is done, just as when neither is used.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --functional-level [2008_R2|2012|2012_R2|2016]

                                                                                                                                        The functional level to prepare for. The default is 2016.
                                                                                                                                    .RE
                                                                                                                                    .PP --forest-prep

                                                                                                                                        Run forest preparation only (unless --domain-prep is also used).
                                                                                                                                    .RE
                                                                                                                                    .PP --domain-prep

                                                                                                                                        Run domain preparation only (unless --forest-prep is also used).
                                                                                                                                    .RE

                                                                                                                        domain info ip_address [options]

                                                                                                                                .PP Print basic info about a domain and the specified DC.

                                                                                                                        domain join dnsdomain [DC|RODC|MEMBER|SUBDOMAIN] [options]

                                                                                                                                .PP Join a domain as either member or backup domain controller.

                                                                                                                        domain kds root-key

                                                                                                                                .PP Manage Key Distribution Service root keys.

                                                                                                                        domain kds root-key create [options]

                                                                                                                                .PP Create KDS root keys

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --use-start-time=["now"|iso8601 or LDIF time string]

                                                                                                                                        The key will be valid from this time.

                                                                                                                                        Valid time format are the string "now", the LDIF format YYYYmmddHHMMSS.0Z, or the ISO format YYYY-mm-dd[*HH[:MM[:SS[.fff[fff]]]][+HH:MM[:SS[.ffffff]]]] where the '*' can be any character, and the optional last '[+HH:MM[:SS[.ffffff]]]' is a timezone offset (e.g. '+00:00' for UTC).

                                                                                                                                    .RE
                                                                                                                                    .PP --json

                                                                                                                                        Output results in JSON format.
                                                                                                                                    .RE

                                                                                                                        domain kds root-key delete --name={GUID}

                                                                                                                                .PP Delete the named KDS root key. Use samba-tool domain kds root-key list to find the name of the key.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --name=NAME

                                                                                                                                        The name of the key to delete. It will be a GUID.

                                                                                                                                    .RE
                                                                                                                                    .PP -v, --verbose

                                                                                                                                        Print all attributes (except secret ones, unless --show secrets is used).
                                                                                                                                        .RE
                                                                                                                                    .PP --json

                                                                                                                                        Output results in JSON format.
                                                                                                                                    .RE

                                                                                                                        domain kds root-key list [options]

                                                                                                                                .PP List KDS root keys. The newest keys are listed first.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --show-secrets

                                                                                                                                        Print secret or potentially sensitive attributes, namely msKds-RootKeyData and msKds-SecretAgreementParam.

                                                                                                                                    .RE
                                                                                                                                    .PP -v, --verbose

                                                                                                                                        Print more attributes (but not secret ones, unless --show secrets is also used).
                                                                                                                                        .RE
                                                                                                                                    .PP --json

                                                                                                                                        Output results in JSON format.
                                                                                                                                    .RE

                                                                                                                        domain kds root-key view [options]

                                                                                                                                .PP View a KDS root key. The default output is similar to that of samba-tool domain kds root-key list --verbose, but with only one key show. The key can be selected by using --latest for the most recent key, or --name to select a key by name.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --latest

                                                                                                                                        View the most recent root key.

                                                                                                                                    .RE
                                                                                                                                    .PP --name=NAME

                                                                                                                                        The name of the key to view. It will be a GUID.

                                                                                                                                    .RE
                                                                                                                                    .PP -v, --verbose

                                                                                                                                        Print all attributes (except secret ones, unless --show secrets is used). This includes attributes that are only useful for LDB bookkeeping.
                                                                                                                                        .RE
                                                                                                                                    .PP --json

                                                                                                                                        Output results in JSON format.
                                                                                                                                    .RE

                                                                                                                        domain leave [options]

                                                                                                                                .PP Run on a domain member, this will cause it to leave the domain.
                                                                                                                                .PP To remove a domain server from the domain, you first need samba-tool domain demote.

                                                                                                                                    .PP --keep-account

                                                                                                                                        Disable the machine account instead of deleting it.
                                                                                                                                    .RE

                                                                                                                        domain level show|raise options [options]

                                                                                                                                .PP Show/raise domain and forest function levels.

                                                                                                                        domain passwordsettings set options [options]

                                                                                                                                .PP Set password settings, including complexity requirements, lockout policy, history length, minimum password length, and minimum and maximum password age on a Samba AD DC server.
                                                                                                                                .PP Use against a Windows DC is possible, but group policy will override it.
                                                                                                                                  .PP -H URL, --URL=URL

                                                                                                                                    LDB URL for database or target server
                                                                                                                                  .RE
                                                                                                                                  .PP -q, --quiet

                                                                                                                                    Be quiet
                                                                                                                                  .RE
                                                                                                                                  .PP --complexity=COMPLEXITY

                                                                                                                                    The password complexity (on | off | default). Default is 'on'
                                                                                                                                  .RE
                                                                                                                                  .PP --store-plaintext=STORE_PLAINTEXT

                                                                                                                                    Store plaintext passwords where account have 'store passwords with reversible encryption' set (on | off | default). Default is 'off'
                                                                                                                                  .RE
                                                                                                                                  .PP --history-length=HISTORY_LENGTH

                                                                                                                                    The password history length (integer | default). Default is 24.
                                                                                                                                  .RE
                                                                                                                                  .PP --min-pwd-length=MIN_PWD_LENGTH

                                                                                                                                    The minimum password length (integer | default). Default is 7.
                                                                                                                                  .RE
                                                                                                                                  .PP --min-pwd-age=MIN_PWD_AGE

                                                                                                                                    The minimum password age (number of days | default). Default is 1.
                                                                                                                                  .RE
                                                                                                                                  .PP --max-pwd-age=MAX_PWD_AGE

                                                                                                                                    The maximum password age (number of days | default). Default is 43.
                                                                                                                                  .RE
                                                                                                                                  .PP --account-lockout-duration=ACCOUNT_LOCKOUT_DURATION

                                                                                                                                    The length of time an account is locked out after exceeding the limit on bad password attempts (number of minutes | default). Default is 30 mins.
                                                                                                                                  .RE
                                                                                                                                  .PP --account-lockout-threshold=ACCOUNT_LOCKOUT_THRESHOLD

                                                                                                                                    The number of bad password attempts allowed before locking out the account (integer | default). Default is 0 (never lock out).
                                                                                                                                  .RE
                                                                                                                                  .PP --reset-account-lockout-after=RESET_ACCOUNT_LOCKOUT_AFTER

                                                                                                                                    After this time is elapsed, the recorded number of attempts restarts from zero (integer | default). Default is 30.
                                                                                                                                  .RE

                                                                                                                        domain passwordsettings show options [options]

                                                                                                                                .PP Display current password settings for the domain.

                                                                                                                                  .PP -H URL, --URL=URL

                                                                                                                                    LDB URL for database or target server
                                                                                                                                  .RE

                                                                                                                        domain passwordsettings pso

                                                                                                                                .PP Manage fine-grained Password Settings Objects (PSOs).

                                                                                                                        domain passwordsettings pso apply pso-name user-or-group-name [options]

                                                                                                                                .PP Applies a PSO's password policy to a user or group.

                                                                                                                        domain passwordsettings pso create pso-name precedence [options]

                                                                                                                                .PP Creates a new Password Settings Object (PSO).

                                                                                                                        domain passwordsettings pso delete pso-name [options]

                                                                                                                                .PP Deletes a Password Settings Object (PSO).

                                                                                                                        domain passwordsettings pso list [options]

                                                                                                                                .PP Lists all Password Settings Objects (PSOs).

                                                                                                                        domain passwordsettings pso set pso-name [options]

                                                                                                                                .PP Modifies a Password Settings Object (PSO).

                                                                                                                        domain passwordsettings pso show user-name [options]

                                                                                                                                .PP Displays a Password Settings Object (PSO).

                                                                                                                        domain passwordsettings pso show-user pso-name [options]

                                                                                                                                .PP Displays the Password Settings that apply to a user.

                                                                                                                        domain passwordsettings pso unapply pso-name user-or-group-name [options]

                                                                                                                                .PP Updates a PSO to no longer apply to a user or group.

                                                                                                                        domain provision

                                                                                                                                .PP Promote an existing domain member or NT4 PDC to an AD DC.

                                                                                                                        domain schemaupgrade [options]

                                                                                                                                .PP Upgrade the schema.

                                                                                                                                    .PP -H, --URL

                                                                                                                                        LDB URL for database or target server.
                                                                                                                                    .RE
                                                                                                                                    .PP --schema [2012|2012_R2|2016|2019]

                                                                                                                                        Upgrade to this Windows schema level. The default is 2019.
                                                                                                                                    .RE
                                                                                                                                    .PP --ldf-file

                                                                                                                                        Apply the schema changes in this LDIF file, rather than updating to a standard schema level.
                                                                                                                                    .RE
                                                                                                                                    .PP --base-dir

                                                                                                                                        Specify an alternate location to find schema LDIF files.
                                                                                                                                    .RE

                                                                                                                        domain tombstones expunge NC [NC [...]] [options]

                                                                                                                                  .PP -H URL, --URL=URL

                                                                                                                                    LDB URL for database or target server
                                                                                                                                  .RE
                                                                                                                                  .PP --current-time=YYYY-MM-DD

                                                                                                                                    The current time to evaluate the tombstone lifetime from, expressed as YYYY-MM-DD
                                                                                                                                  .RE
                                                                                                                                  .PP --tombstone-lifetime=DAYS

                                                                                                                                    Number of days a tombstone should be preserved for
                                                                                                                                  .RE

                                                                                                                        domain trust

                                                                                                                                .PP Domain and forest trust management.

                                                                                                                        domain trust create DOMAIN options [options]

                                                                                                                                .PP Create a domain or forest trust.

                                                                                                                        domain trust modify DOMAIN options [options]

                                                                                                                                .PP Modify a domain or forest trust.

                                                                                                                        domain trust delete DOMAIN options [options]

                                                                                                                                .PP Delete a domain trust.

                                                                                                                        domain trust list options [options]

                                                                                                                                .PP List domain trusts.

                                                                                                                        domain trust namespaces [DOMAIN] options [options]

                                                                                                                                .PP Manage forest trust namespaces.

                                                                                                                        domain trust show DOMAIN options [options]

                                                                                                                                .PP Show trusted domain details.

                                                                                                                        domain trust validate DOMAIN options [options]

                                                                                                                                .PP Validate a domain trust.

  drs

    .PP Manage Directory Replication Services (DRS).

drs bind

        .PP Show DRS capabilities of a server.

drs clone-dc-database dnsdomain --targetdir=DIR [options]

        .PP Replicate an initial clone of domain, but DO NOT JOIN it.

          .PP --server=DC

                Clone this DC.
              .RE
              .PP --targetdir=TARGETDIR

                    where to store provision (required).
                  .RE
                  .PP -q, --quiet

                        Be quiet.
                      .RE
                      .PP --include-secrets

                            Also replicate secret values.
                          .RE
                          .PP --backend-store=BACKENDSTORE

                                Specify the database backend to be used (default is tdb).
                              .RE
                              .PP --backend-store-size=SIZE

                                    Specify the size of the backend database, currentlyonly supported by lmdb backends (default is 8 GB).
                                  .RE

                        drs uptodateness [options]

                                .PP Show uptodateness status.

                                  .PP -H URL, --URL=URL

                                        LDB URL for database or target server
                                      .RE
                                      .PP -p PARTITION, --partition=PARTITION

                                            restrict to this partition
                                          .RE
                                          .PP --json

                                                Print data in json format
                                              .RE
                                              .PP --maximum

                                                    Print maximum out-of-date-ness only
                                                  .RE
                                                  .PP --median

                                                        Print median out-of-date-ness only
                                                      .RE
                                                      .PP --full

                                                            Print full out-of-date-ness data
                                                          .RE

                                                drs kcc

                                                        .PP Trigger knowledge consistency center run.

                                                drs options

                                                        .PP Query or change options for NTDS Settings object of a domain controller.

                                                drs replicate destination_DC source_DC NC [options]

                                                        .PP Replicate a naming context between two DCs.

                                                drs showrepl

                                                        .PP Show replication status. The [--json] option results in JSON output, and with the [--summary] option produces very little output when the replication status seems healthy.

  dsacl

    .PP Administer DS ACLs

dsacl delete

        .PP Delete an access list entry on a directory object.

dsacl get

        .PP Print access list on a directory object.

dsacl set

        .PP Modify access list on a directory object.

  forest

    .PP Manage Forest configuration.

forest directory_service

        .PP Manage directory_service behaviour for the forest.

forest directory_service dsheuristics VALUE

        .PP Modify dsheuristics directory_service configuration for the forest.

forest directory_service show

        .PP Show current directory_service configuration for the forest.

  fsmo

    .PP Manage Flexible Single Master Operations (FSMO).

fsmo seize [options]

        .PP Seize the role.

fsmo show

        .PP Show the roles.

fsmo transfer [options]

        .PP Transfer the role.

  gpo

    .PP Manage Group Policy Objects (GPO).

gpo aclcheck [options]

        .PP Create an empty GPO.
        .PP Check all GPOs have matching LDAP and DS ACLs.

        .PP -H URL, --URL=URL

            LDB URL for database or target server
            .RE

    gpo admxload [options]

            .PP Loads samba admx files to sysvol

            .PP -H URL, --URL=URL

                LDB URL for database or target server
                .RE
                .PP --admx-dir=ADMX_DIR

                    Directory where admx templates are stored
                    .RE

            gpo backup gpo[options]

                    .PP Backup a GPO.

                      .PP -H H

                            LDB URL for database or target server
                          .RE
                          .PP --tmpdir=TMPDIR

                                Temporary directory for copying policy files
                              .RE
                              .PP --generalize

                                    Generalize XML entities to restore
                                  .RE
                                  .PP --entities=ENT_FILE

                                        File to export defining XML entities for the restore
                                      .RE

                            gpo create displayname [options]

                                    .PP Create an empty GPO.

                            gpo cse list

                                List the registered Client Side Extensions (CSEs) on the current host.

                            gpo cse register cse_file cse_name [options]

                                Register a Client Side Extension (CSE) on the current host.

                                This command takes a CSE filename as an argument, and registers it for applying policy on the current host. This is not necessary for CSEs which are distributed with the current version of Samba, but is useful for installing experimental CSEs or custom built CSEs.

                                The cse_file argument MUST be a permanent location for the CSE. The register command does not copy the file to some other directory. The samba-gpupdate command will execute the CSE from the exact location specified from this command.
                                      .PP --machine

                                            Whether to register the CSE as Machine policy
                                          .RE
                                          .PP --user

                                                Whether to register the CSE as User policy
                                              .RE

                                    gpo cse unregister GUID

                                        Unregister a Client Side Extension (CSE) from the current host.

                                        This command takes a unique GUID as an argument (representing a registered CSE), and unregisters it for applying policy on the current host. Use the `samba-tool gpo cse list` command to determine the unique GUIDs of CSEs.

                                    gpo del gpo [options]

                                            .PP Delete GPO.

                                    gpo dellink container_dn gpo [options]

                                            .PP Delete GPO link from a container.

                                    gpo fetch gpo [options]

                                            .PP Download a GPO.

                                    gpo getinheritance container_dn [options]

                                            .PP Get inheritance flag for a container.

                                    gpo getlink container_dn [options]

                                            .PP List GPO Links for a container.

                                    gpo list username [options]

                                            .PP List GPOs for an account.

                                    gpo listall

                                            .PP List all GPOs.

                                    gpo listcontainers gpo [options]

                                            .PP List all linked containers for a GPO.

                                    gpo load gpo [options]

                                        Load policies onto a GPO.

                                        Reads json from standard input until EOF, unless a json formatted file is provided via --content.
                                          .PP Example json_input:

                                            [
                                                {
                                                    "keyname": "Software\Policies\Mozilla\Firefox\Homepage",
                                                    "valuename": "StartPage",
                                                    "class": "USER",
                                                    "type": "REG_SZ",
                                                    "data": "homepage"
                                                },
                                                {
                                                    "keyname": "Software\Policies\Mozilla\Firefox\Homepage",
                                                    "valuename": "URL",
                                                    "class": "USER",
                                                    "type": "REG_SZ",
                                                    "data": "google.com"
                                                },
                                                {
                                                    "keyname": "Software\Microsoft\Internet Explorer\Toolbar",
                                                    "valuename": "IEToolbar",
                                                    "class": "USER",
                                                    "type": "REG_BINARY",
                                                    "data": [0]
                                                },
                                                {
                                                    "keyname": "Software\Policies\Microsoft\InputPersonalization",
                                                    "valuename": "RestrictImplicitTextCollection",
                                                    "class": "USER",
                                                    "type": "REG_DWORD",
                                                    "data": 1
                                                }
                                                ]

                                            .PP Valid class attributes: MACHINE|USER|BOTH Data arrays are interpreted as bytes.
                                            .PP The --machine-ext-name and --user-ext-name options are multi-value inputs which respectively set the gPCMachineExtensionNames and gPCUserExtensionNames ldap attributes on the GPO. These attributes must be set to the correct GUID names for Windows Group Policy to work correctly. These GUIDs represent the client side extensions to apply on the machine. Linux Group Policy does not enforce this constraint. {35378EAC-683F-11D2-A89A-00C04FBBCFA2} is provided by default, which enables most Registry policies.
                                              .PP -H H

                                                    LDB URL for database or target server
                                                  .RE
                                                  .PP --content=CONTENT

                                                        JSON file of policy inputs
                                                      .RE
                                                      .PP --machine-ext-name=MACHINE_EXTS

                                                            A machine extension name to add to gPCMachineExtensionNames
                                                          .RE
                                                          .PP --user-ext-name=USER_EXTS

                                                                A user extension name to add to gPCUserExtensionNames
                                                              .RE
                                                              .PP --replace

                                                                    Replace the existing Group Policies, rather than merging
                                                                  .RE

                                                        gpo manage security list gpo [options]

                                                                .PP List Samba Security Group Policy from the sysvol.
                                                                .PP This command lists security settings from the sysvol that will be applied to winbind clients. These settings only apply to the AD DC.
                                                                .PP Example:

                                                                samba-tool gpo manage security list {31B2F340-016D-11D2-945F-00C04FB984F9}

                                                                  .PP -H URL, --URL=URL

                                                                        LDB URL for database or target server
                                                                      .RE

                                                            gpo manage security set gpo [options]

                                                                    .PP Set Samba Security Group Policy to the sysvol.
                                                                    .PP This command sets a security setting to the sysvol for applying to winbind clients. Not providing a value will unset the policy. These settings only apply to the AD DC.
                                                                    .PP Example:

                                                                    samba-tool gpo manage security set {31B2F340-016D-11D2-945F-00C04FB984F9} MaxTicketAge 10

                                                                    .PP Possible policies:
                                                                        .PP MaxTicketAge

                                                                              Maximum lifetime for user ticket (hours).
                                                                            .RE
                                                                            .PP MaxServiceAge

                                                                                  Maximum lifetime for service ticket in minutes. Defined in minutes
                                                                                .RE
                                                                                .PP MaxRenewAge

                                                                                      Maximum lifetime for user ticket renewal, in minutes.
                                                                                    .RE
                                                                                    .PP MinimumPasswordAge

                                                                                          Minimum password age, in days.
                                                                                        .RE
                                                                                        .PP MaximumPasswordAge

                                                                                              Maximum password age, in days.
                                                                                            .RE
                                                                                            .PP MinimumPasswordLength

                                                                                                  Minimum password length, in characters.
                                                                                                .RE
                                                                                                .PP PasswordComplexity

                                                                                                      Password must meet complexity requirements. 1 is Enabled, 0 is Disabled.
                                                                                                    .RE

                                                                                                  .PP -H URL, --URL=URL

                                                                                                        LDB URL for database or target server
                                                                                                      .RE
                                                                                                    .PP List Samba Security Group Policy from the sysvol.
                                                                                                    .PP This command lists security settings from the sysvol that will be applied to winbind clients. These settings only apply to the AD DC.
                                                                                                    .PP Example:

                                                                                                    samba-tool gpo manage security list {31B2F340-016D-11D2-945F-00C04FB984F9}

                                                                                                      .PP -H URL, --URL=URL

                                                                                                            LDB URL for database or target server
                                                                                                          .RE

                                                                                                gpo manage smb_conf list

                                                                                                      .PP List smb.conf settings from the sysvol that will be applied to winbind clients.
                                                                                                      .PP Example:

                                                                                                        samba-tool gpo manage smb_conf list {31B2F340-016D-11D2-945F-00C04FB984F9}

                                                                                                          .PP -H URL, --URL=URL

                                                                                                                LDB URL for database or target server
                                                                                                              .RE

                                                                                                    gpo manage smb_conf set gpo [value] [options]

                                                                                                        Set or unset an smb.conf setting to the sysvol for applying to winbind clients.

                                                                                                        If a value is provided, that is the smb.conf value used; if no value is provided, the policy is removed.
                                                                                                          .PP Example:

                                                                                                            samba-tool gpo manage smb_conf set {31B2F340-016D-11D2-945F-00C04FB984F9} 'apply gpo policies' yes

                                                                                                              .PP -H URL, --URL=URL

                                                                                                                    LDB URL for database or target server
                                                                                                                  .RE

                                                                                                        gpo setinheritance container_dn block|inherit [options]

                                                                                                                .PP Set inheritance flag on a container.

                                                                                                        gpo setlink container_dn gpo [options]

                                                                                                                .PP Add or Update a GPO link to a container.

                                                                                                        gpo removegpo [options]

                                                                                                                .PP Show information for a GPO.

                                                                                                            Remove policies from a GPO.

                                                                                                            Reads json from standard input until EOF, unless a json formatted file is provided via --content.

                                                                                                                Example json_input:
                                                                                                                [
                                                                                                                    {
                                                                                                                        "keyname": "Software\Policies\Mozilla\Firefox\Homepage",
                                                                                                                        "valuename": "StartPage",
                                                                                                                        "class": "USER",
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "keyname": "Software\Policies\Mozilla\Firefox\Homepage",
                                                                                                                        "valuename": "URL",
                                                                                                                        "class": "USER",
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "keyname": "Software\Microsoft\Internet Explorer\Toolbar",
                                                                                                                        "valuename": "IEToolbar",
                                                                                                                        "class": "USER"
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "keyname": "Software\Policies\Microsoft\InputPersonalization",
                                                                                                                        "valuename": "RestrictImplicitTextCollection",
                                                                                                                        "class": "USER"
                                                                                                                    }
                                                                                                                ]

                                                                                                            Valid class attributes: MACHINE|USER|BOTH
                                                                                                                  .PP -H H

                                                                                                                        LDB URL for database or target server
                                                                                                                      .RE
                                                                                                                      .PP --content=CONTENT

                                                                                                                            JSON file of policy inputs
                                                                                                                          .RE
                                                                                                                          .PP --machine-ext-name=MACHINE_EXTS

                                                                                                                                A machine extension name to remove from gPCMachineExtensionNames
                                                                                                                              .RE
                                                                                                                              .PP --user-ext-name=USER_EXTS

                                                                                                                                    A user extension name to remove from gPCUserExtensionNames
                                                                                                                                  .RE
                                                                                                                                  .PP --color=always|never|auto

                                                                                                                                    use colour if available (default: auto)
                                                                                                                                  .RE

                                                                                                                        gpo restore displayname backup location [options]

                                                                                                                            Restore a GPO to a new container.
                                                                                                                                  .PP -H H

                                                                                                                                    LDB URL for database or target server
                                                                                                                                  .RE
                                                                                                                                  .PP --tmpdir=TMPDIR

                                                                                                                                    Temporary directory for copying policy files
                                                                                                                                  .RE
                                                                                                                                  .PP --entities=ENTITIES

                                                                                                                                    File defining XML entities to insert into DOCTYPE header
                                                                                                                                  .RE
                                                                                                                                  .PP --restore-metadata

                                                                                                                                    Keep the old GPT.INI file and associated version number
                                                                                                                                  .RE

                                                                                                                        gpo show gpo [options]

                                                                                                                                .PP Show information for a GPO.

                                                                                                                        gpo manage symlink list

                                                                                                                                .PP List VGP Symbolic Link Group Policy from the sysvol

                                                                                                                        gpo manage symlink add

                                                                                                                                .PP Adds a VGP Symbolic Link Group Policy to the sysvol

                                                                                                                        gpo manage symlink remove

                                                                                                                                .PP Removes a VGP Symbolic Link Group Policy from the sysvol

                                                                                                                        gpo manage files list

                                                                                                                                .PP List VGP Files Group Policy from the sysvol

                                                                                                                        gpo manage files add

                                                                                                                                .PP Add VGP Files Group Policy to the sysvol

                                                                                                                        gpo manage files remove

                                                                                                                                .PP Remove VGP Files Group Policy from the sysvol

                                                                                                                        gpo manage openssh list

                                                                                                                                .PP List VGP OpenSSH Group Policy from the sysvol

                                                                                                                        gpo manage openssh set

                                                                                                                                .PP Sets a VGP OpenSSH Group Policy to the sysvol

                                                                                                                        gpo manage sudoers add

                                                                                                                                .PP Adds a Samba Sudoers Group Policy to the sysvol.

                                                                                                                        gpo manage sudoers list

                                                                                                                                .PP List Samba Sudoers Group Policy from the sysvol.

                                                                                                                        gpo manage sudoers remove

                                                                                                                                .PP Removes a Samba Sudoers Group Policy from the sysvol.

                                                                                                                        gpo manage scripts startup list

                                                                                                                                .PP List VGP Startup Script Group Policy from the sysvol

                                                                                                                        gpo manage scripts startup add

                                                                                                                                .PP Adds VGP Startup Script Group Policy to the sysvol

                                                                                                                        gpo manage scripts startup remove

                                                                                                                                .PP Removes VGP Startup Script Group Policy from the sysvol

                                                                                                                        gpo manage motd list

                                                                                                                                .PP List VGP MOTD Group Policy from the sysvol.

                                                                                                                        gpo manage motd set

                                                                                                                                .PP Sets a VGP MOTD Group Policy to the sysvol

                                                                                                                        gpo manage issue list

                                                                                                                                .PP List VGP Issue Group Policy from the sysvol.

                                                                                                                        gpo manage issue set

                                                                                                                                .PP Sets a VGP Issue Group Policy to the sysvol

                                                                                                                        gpo manage access add

                                                                                                                                .PP Adds a VGP Host Access Group Policy to the sysvol

                                                                                                                        gpo manage access list

                                                                                                                                .PP List VGP Host Access Group Policy from the sysvol

                                                                                                                        gpo manage access remove

                                                                                                                                .PP Remove a VGP Host Access Group Policy from the sysvol

  group

    .PP Manage groups.

group add groupname [options]

        .PP Create a new AD group.

group create groupname [options]

        .PP Add a new AD group. This is a synonym for the samba-tool group add command and is available for compatibility reasons only. Please use samba-tool group add instead.

group addmembers groupname members [options]

        .PP Add members to an AD group.

group addunixattrs groupname gidnumber [options]

        .PP Add RFC2307 Unix attributes to a group account in the Active Directory domain. The groupname specified on the command is the sAMaccountName.

    Unix (RFC2307) attributes will be added to the group account.

    Add 'idmap_ldb:use rfc2307 = Yes' to smb.conf to use these attributes for UID/GID mapping.

    The command may be run from the root userid or another authorized userid. The -H or --URL= option can be used to execute the command against a remote server.

    Example1:

        samba-tool group addunixattrs Group1 10000

    Example1 shows how to add RFC2307 attributes to a domain enabled group account.

    The groups Unix ID will be set to '10000', provided this ID isn't already in use.
          .PP -H URL, --URL=URL

                LDB URL for database or target server
              .RE

    group delete groupname [options]

            .PP Delete an AD group.

    group edit groupname

            .PP Edit a group AD object.

            .PP --editor=EDITOR

                Specifies the editor to use instead of the system default, or 'vi' if no system default is set.
                .RE

        group list

                .PP List all groups.

        group listmembers groupname [options]

                .PP List all members of the specified AD group.
                .PP By default the sAMAccountNames are listed. If no sAMAccountName is available, the CN will be used instead.

                .PP --full-dn

                    List the distinguished names instead of the sAMAccountNames.
                    .RE
                    .PP --hide-expired

                        Do not list expired group members.
                        .RE
                        .PP --hide-disabled

                            Do not list disabled group members.
                            .RE

                    group move groupname new_parent_dn [options]

                            .PP This command moves a group into the specified organizational unit or container.
                            .PP The groupname specified on the command is the sAMAccountName.
                            .PP The name of the organizational unit or container can be specified as a full DN or without the domainDN component.
                            .PP

                    group removemembers groupname members [options]

                            .PP Remove members from the specified AD group.

                    group show groupname [options]

                            .PP Show group object and it's attributes.

                    group stats [options]

                            .PP Show statistics for overall groups and group memberships.

                    group rename groupname [options]

                            .PP Rename a group and related attributes.
                            .PP This command allows to set the group's name related attributes. The group's CN will be renamed automatically. The group's CN will be the sAMAccountName. Use the --force-new-cn option to specify the new CN manually and the --reset-cn to reset this change.
                            .PP Use an empty attribute value to remove the specified attribute.
                            .PP The groupname specified on the command is the sAMAccountName.

                            .PP --force-new-cn=NEW_CN

                                Specify a new CN (RDN) instead of using the sAMAccountName.
                                .RE
                                .PP --reset-cn

                                    Set the CN to the sAMAccountName.
                                    .RE
                                    .PP --mail-address=MAIL_ADDRESS

                                        New mail address
                                        .RE
                                        .PP --samaccountname=SAMACCOUNTNAME

                                            New account name (sAMAccountName/logon name)
                                            .RE

  ldapcmp URL1 URL2 domain|configuration|schema|dnsdomain|dnsforest [options]

    .PP Compare two LDAP databases.

  ntacl

    .PP Manage NT ACLs.

ntacl changedomsid original-domain-SID new-domain-SID file [options]

        .PP Change the domain SID for ACLs. Can be used to change all entries in acl_xattr when the machine's SID has accidentally changed or the data set has been copied to another machine either via backup/restore or rsync.

        .PP --use-ntvfs

            Set the ACLs directly to the TDB or xattr. The POSIX permissions will NOT be changed, only the NT ACL will be stored.
            .RE
            .PP --service=SERVICE

                Specify the name of the smb.conf service to use. This option is required in combination with the --use-s3fs option.
                .RE
                .PP --use-s3fs

                    Set the ACLs for use with the default s3fs file server via the VFS layer. This option requires a smb.conf service, specified by the --service=SERVICE option.
                    .RE
                    .PP --xattr-backend=[native|tdb]

                        Specify the xattr backend type (native fs or tdb).
                        .RE
                        .PP --eadb-file=EADB_FILE

                            Name of the tdb file where attributes are stored.
                            .RE
                            .PP --recursive

                                Set the ACLs for directories and their contents recursively.
                                .RE
                                .PP --follow-symlinks

                                    Follow symlinks when --recursive is specified.
                                    .RE
                                    .PP --verbose

                                        Verbosely list files and ACLs which are being processed.
                                        .RE

                                ntacl getdosinfo file [options]

                                        .PP Get DOS info of a file from xattr.

                                ntacl get file [options]

                                        .PP Get ACLs on a file.

                                ntacl set acl file [options]

                                        .PP Set ACLs on a file.

                                ntacl sysvolcheck

                                        .PP Check sysvol ACLs match defaults (including correct ACLs on GPOs).

                                ntacl sysvolreset

                                        .PP Reset sysvol ACLs to defaults (including correct ACLs on GPOs).

  ou

    .PP Manage organizational units (OUs).

ou add ou_dn [options]

        .PP Add a new organizational unit.
        .PP The name of the organizational unit can be specified as a full DN or without the domainDN component.

        .PP --description=DESCRIPTION

            Specify OU's description.
            .RE

    ou create ou_dn [options]

            .PP Add a new organizational unit. This is a synonym for the samba-tool ou add command and is available for compatibility reasons only. Please use samba-tool ou add instead.

    ou delete ou_dn [options]

            .PP Delete an organizational unit.
            .PP The name of the organizational unit can be specified as a full DN or without the domainDN component.

            .PP --force-subtree-delete

                Delete organizational unit and all children recursively.
                .RE

        ou list [options]

                .PP List all organizational units.

                .PP --full-dn

                    Display DNs including the base DN.
                    .RE

            ou listobjects ou_dn [options]

                    .PP List all objects in an organizational unit.
                    .PP The name of the organizational unit can be specified as a full DN or without the domainDN component.

                    .PP --full-dn

                        Display DNs including the base DN.
                        .RE
                        .PP -r|--recursive

                            List objects recursively.
                            .RE

                    ou move old_ou_dn new_parent_dn [options]

                            .PP Move an organizational unit.
                            .PP The name of the organizational units can be specified as a full DN or without the domainDN component.

                    ou rename old_ou_dn new_ou_dn [options]

                            .PP Rename an organizational unit.
                            .PP The name of the organizational units can be specified as a full DN or without the domainDN component.

  processes

    .PP List samba server processes.
    .PP If no processes are show, but Samba is running, it is possible that samba-tool has not found the correct smb.conf, and the use of -s/--configfile is required.

    .PP --name=NAME

        Show processes associated with the given name.
        .RE
        .PP --pid=PID

            Show names associated with the PID.
            .RE

  rodc

    .PP Manage Read-Only Domain Controller (RODC).

rodc preload SID|DN|accountname [options]

        .PP Preload one account for an RODC.

  schema

    .PP Manage and query schema.

schema attribute modify attribute [options]

        .PP Modify the behaviour of an attribute in schema.

schema attribute show attribute [options]

        .PP Display an attribute schema definition.

schema attribute show_oc attribute [options]

        .PP Show objectclasses that MAY or MUST contain this attribute.

schema objectclass show objectclass [options]

        .PP Display an objectclass schema definition.

  service-account

    .PP Service account management.

service-account list

        .PP List service accounts on the domain.

            .PP -H, --URL

                    LDB URL for database or target server.
                .RE
                .PP --json

                        View service accounts as JSON instead of a list.
                    .RE

        service-account view

                .PP View a single service account on the domain.

                    .PP -H, --URL

                            LDB URL for database or target server.
                        .RE
                        .PP --name

                                Account name of service account to view (required).
                            .RE

                service-account create

                        .PP Create a new service account on the domain.

                            .PP -H, --URL

                                    LDB URL for database or target server.
                                .RE
                                .PP --name

                                        Account name of service account (required).
                                    .RE
                                    .PP --dns-host-name

                                            DNS hostname of this service account (required).
                                        .RE
                                        .PP --group-msa-membership

                                                Optional Group MSA Membership SDDL.
                                            .RE
                                            .PP --managed-password-interval

                                                    Managed password refresh interval in days.
                                                .RE

                                    service-account modify

                                            .PP Modify an existing service account on the domain.

                                                .PP -H, --URL

                                                        LDB URL for database or target server.
                                                    .RE
                                                    .PP --name

                                                            Account name of service account (required).
                                                        .RE
                                                        .PP --dns-host-name

                                                                Update DNS hostname of this service account.
                                                            .RE
                                                            .PP --group-msa-membership

                                                                    Update Group MSA Membership SDDL.
                                                                .RE

                                                    service-account delete

                                                            .PP Delete a service accounts on the domain.

                                                                .PP -H, --URL

                                                                        LDB URL for database or target server.
                                                                    .RE
                                                                    .PP --name

                                                                            Account name of service account to delete.
                                                                        .RE

  service-account group-msa-membership

    .PP Service account Group MSA Membership management.

service-account group-msa-membership show

        .PP Display Group MSA Membership for a service account.

            .PP -H, --URL

                    LDB URL for database or target server.
                .RE
                .PP --name

                        Account name of service account (required).
                    .RE
                    .PP --json

                            Return as JSON instead of a list.
                        .RE

            service-account group-msa-membership add

                    .PP Add a principal to Group MSA Membership for a service account.

                        .PP -H, --URL

                                LDB URL for database or target server.
                            .RE
                            .PP --name

                                    Account name of service account (required).
                                .RE
                                .PP --principal

                                        Name, DN or SID of principal to add.
                                    .RE

                        service-account group-msa-membership remove

                                .PP Remove a principal from Group MSA Membership for a service account.

                                    .PP -H, --URL

                                            LDB URL for database or target server.
                                        .RE
                                        .PP --name

                                                Account name of service account (required).
                                            .RE
                                            .PP --principal

                                                    Name, DN or SID of principal to remove.
                                                .RE

  shell

    .PP Opens an interactive Samba Python shell.

shell [options]

        .PP Opens an interactive Python shell for Samba ldb connection.

            .PP -H, --URL

                    LDB URL for database or target server.
                .RE

  sites

    .PP Manage sites.

sites list [options]

        .PP List sites.

            .PP --json

                    Output as JSON instead of a list
                .RE

    sites view site [options]

            .PP View site details.

    sites create site [options]

            .PP Create a new site.

    sites remove site [options]

            .PP Delete an existing site.

    sites subnet list site [options]

            .PP List subnets for a site.

                .PP --json

                        Output as JSON instead of a list
                    .RE

        sites subnet view subnet [options]

                .PP View subnet details.

        sites subnet create subnet site-of-subnet [options]

                .PP Create a new subnet.

        sites subnet remove subnet [options]

                .PP Delete an existing subnet.

        sites subnet set-site subnet site-of-subnet [options]

                .PP Assign a subnet to a site.

  spn

    .PP Manage Service Principal Names (SPN).

spn add name user [options]

        .PP Create a new SPN.

spn delete name [user] [options]

        .PP Delete an existing SPN.

spn list user [options]

        .PP List SPNs of a given user.

  testparm

    .PP Check the syntax of the configuration file.

  time

    .PP Retrieve the time on a server.

  user

    .PP Manage users.

user add username [password]

        .PP Add a new user to the Active Directory Domain.

user addunixattrs username uid-number [options]

        .PP Add RFC2307 attributes to a user.
        .PP This command adds Unix attributes to a user account in the Active Directory domain.
        .PP The username specified on the command is the sAMaccountName.
        .PP You must supply a unique uid.
        .PP Unix (RFC2307) attributes will be added to the user account.
        .PP If you supply a group id with '--gid-number', this will be used for the users Unix 'gidNumber' attribute.
        .PP If '--gid-number' is not supplied, the users Unix gidNumber will be set to the one found in 'Domain Users', this means Domain Users must have a gidNumber attribute.
        .PP If '--unix-home' is not supplied, the users Unix home directory will be set to /home/DOMAIN/username.
        .PP If '--login-shell' is not supplied, the users Unix login shell will be set to '/bin/sh'
        .PP If ---gecos' is not supplied, the users Unix gecos field will be set to the user's 'CN' attribute.
        .PP Add 'idmap_ldb:use rfc2307 = Yes' to the smb.conf on DCs to use these attributes for UID/GID mapping.
        .PP The command may be run from the root userid or another authorised userid. The -H or --URL= option can be used to execute the command against a remote server.
        .PP Example1:

        samba-tool user addunixattrs User1 10001

    Example1 shows how to add RFC2307 attributes to a domain enabled user account, Domain Users will be set as the users gidNumber.
        .PP The users Unix ID will be set to '10001', provided this ID isn't already in use.
        .PP Example2:

        samba-tool user addunixattrs User2 10002 --gid-number=10001 --unix-home=/home/User2

        .PP Example2 shows how to add RFC2307 attributes to a domain enabled user account.
        .PP The users Unix ID will be set to '10002', provided this ID isn't already in use.
        .PP The users gidNumber attribute will be set to '10001'
        .PP The users Unix home directory will be set to '/home/user2'
        .PP Example3:

        samba-tool user addunixattrs User3 10003 --gid-number=10001 --login-shell=/bin/false --gecos='User3 test'

        .PP Example3 shows how to add RFC2307 attributes to a domain enabled user account.
        .PP The users Unix ID will be set to '10003', provided this ID isn't already in use. The users gidNumber attribute will be set to '10001'. The users Unix login shell will be set to '/bin/false'. The users gecos field will be set to 'User3 test'.
          .PP -H URL, --URL=URL

                LDB URL for database or target server
              .RE
              .PP --gid-number=GROUP_ID

                    User's Unix/RFC2307 GID
                  .RE
                  .PP --unix-home=DIR

                        User's Unix/RFC2307 home directory
                      .RE
                      .PP --login-shell=SHELL

                            User's Unix/RFC2307 login shell
                          .RE
                          .PP --gecos=GECOS

                                User's Unix/RFC2307 GECOS field
                              .RE
                              .PP --uid=USER_ID

                                    User's Unix/RFC2307 user id
                                  .RE

                        user create username [password]

                                .PP Add a new user. This is a synonym for the samba-tool user add command and is available for compatibility reasons only. Please use samba-tool user add instead.

                        user delete username [options]

                                .PP Delete an existing user account.

                        user disable username

                                .PP Disable a user account.

                                .PP --remove-supplemental-groups

                                    Remove user from all groups, but keep the primary group.
                                    .RE

                            user edit username

                                    .PP Edit a user account AD object.

                                    .PP --editor=EDITOR

                                        Specifies the editor to use instead of the system default, or 'vi' if no system default is set.
                                        .RE

                                user enable username

                                        .PP Enable a user account.

                                user list

                                        .PP List all users.
                                        .PP By default the user's sAMAccountNames are listed.

                                        .PP --full-dn

                                            List user's distinguished names instead of the sAMAccountNames.
                                            .RE
                                            .PP -b BASE_DN|--base-dn=BASE_DN

                                                Specify base DN to use. Only users under the specified base DN will be listed.
                                                .RE
                                                .PP --hide-expired

                                                    Do not list expired user accounts.
                                                    .RE
                                                    .PP --hide-disabled

                                                        Do not list disabled user accounts.
                                                        .RE
                                                        .PP --locked-only

                                                            Only list locked user accounts.
                                                            .RE

                                                    user setprimarygroup username primarygroupname

                                                            .PP Set the primary group a user account.

                                                    user getgroups username

                                                            .PP Get the direct group memberships of a user account.

                                                    user show username [options]

                                                            .PP Display a user AD object.

                                                            .PP --attributes=USER_ATTRS

                                                                Comma separated list of attributes, which will be printed.
                                                                .RE

                                                        user move username new_parent_dn [options]

                                                                .PP This command moves a user account into the specified organizational unit or container.
                                                                .PP The username specified on the command is the sAMAccountName.
                                                                .PP The name of the organizational unit or container can be specified as a full DN or without the domainDN component.

                                                        user password [options]

                                                                .PP Change password for a user account (the one provided in authentication).

                                                        user rename username [options]

                                                                .PP Rename a user and related attributes.
                                                                .PP This command allows to set the user's name related attributes. The user's CN will be renamed automatically. The user's new CN will be made up by combining the given-name, initials and surname. A dot ('.') will be appended to the initials automatically, if required. Use the --force-new-cn option to specify the new CN manually and --reset-cn to reset this change.
                                                                .PP Use an empty attribute value to remove the specified attribute.
                                                                .PP The username specified on the command is the sAMAccountName.

                                                                .PP --surname=SURNAME

                                                                    New surname
                                                                    .RE
                                                                    .PP --given-name=GIVEN_NAME

                                                                        New given name
                                                                        .RE
                                                                        .PP --initials=INITIALS

                                                                            New initials
                                                                            .RE
                                                                            .PP --force-new-cn=NEW_CN

                                                                                Specify a new CN (RDN) instead of using a combination of the given name, initials and surname.
                                                                                .RE
                                                                                .PP --reset-cn

                                                                                    Set the CN to the default combination of given name, initials and surname.
                                                                                    .RE
                                                                                    .PP --display-name=DISPLAY_NAME

                                                                                        New display name
                                                                                        .RE
                                                                                        .PP --mail-address=MAIL_ADDRESS

                                                                                            New email address
                                                                                            .RE
                                                                                            .PP --samaccountname=SAMACCOUNTNAME

                                                                                                New account name (sAMAccountName/logon name)
                                                                                                .RE
                                                                                                .PP --upn=UPN

                                                                                                    New user principal name
                                                                                                    .RE

                                                                                            user sensitive accountname [show|on|off] [options]

                                                                                                    .PP Set/unset or show UF_NOT_DELEGATED for an account.
                                                                                                      .PP -H URL, --URL=URL

                                                                                                            LDB URL for database or target server
                                                                                                          .RE

                                                                                                user setexpiry username [options]

                                                                                                        .PP Set the expiration of a user account.

                                                                                                user setpassword username [options]

                                                                                                        .PP Sets or resets the password of a user account.

                                                                                                user unlock username [options]

                                                                                                        .PP This command unlocks a user account in the Active Directory domain.

                                                                                                user getpassword username [options]

                                                                                                        .PP Gets the password of a user account.

                                                                                                user get-kerberos-ticket username [options]

                                                                                                        .PP Gets a Kerberos Ticket Granting Ticket as the account.

                                                                                                user syncpasswords --cache-ldb-initialize [options]

                                                                                                        .PP Syncs the passwords of all user accounts, using an optional script.
                                                                                                        .PP Note that this command should run on a single domain controller only (typically the PDC-emulator).

                                                                                                user auth policy assign username [options]

                                                                                                        .PP Set assigned authentication policy for user.

                                                                                                            .PP --policy

                                                                                                                    Name of authentication policy to assign or leave empty to remove.
                                                                                                                .RE

                                                                                                    user auth policy remove username

                                                                                                            .PP Remove assigned authentication policy from user.

                                                                                                    user auth policy view username

                                                                                                            .PP View the assigned authentication policy for user.

                                                                                                    user auth silo assign username [options]

                                                                                                            .PP Set assigned authentication silo for user.

                                                                                                                .PP --silo

                                                                                                                        Name of authentication silo to assign or leave empty to remove.
                                                                                                                    .RE

                                                                                                        user auth silo remove username

                                                                                                                .PP Remove assigned authentication silo from user.

                                                                                                        user auth silo view username

                                                                                                                .PP View the assigned authentication silo for user.

  user keytrust

    .PP Manage Key Credential Links for a user.
    .PP This can populate, describe or delete msDS-KeyCredentialLink attributes.

user keytrust add username public-key-or-certificate[options]

    Add a key-credential-link, which is a linked attribute that holds a public key in a binary field.

    The second argument is a filename that should refer to a 2048 bit RSA key (or a certificate containing that key) in PEM or DER format. By default the encoding format will be detected automatically, but you can attempt to override this with --encoding option. Other types of public key are not supported, though the --force option can be used to add a non-2048 bit key.
          .PP --link-target=DN

                link to this DN (default: the user's DN)
              .RE
              .PP --encoding=ENCODING

                    Key format, either pem, der, or auto. The default is auto, which is likely to detect the correct format in all circumstances.
                  .RE
                  .PP --force

                        proceed with operations that seems ill-fated
                      .RE

            user keytrust delete username [options]

                Delete a key-credential-link.

                The link to be deleted can be selected in a number of ways. --all will delete all key credential links for the user (often there will only be one). The --link-target option selects a key credential link based on the DN targeted by the link. The --fingerprint option selects a link to delete based on the key fingerprint. This is the SHA256 of the DER-encoded key material, expressed as hex-pairs separated by colons. See user keytrust view to get a list of links and their fingerprints.

                If more than one of --link-target, --fingerprint, and --all are used, links matched by any of them will be deleted.

                The --dry-run option will prevent links from being deleted, and instead indicate what would happen if it was omitted.
                      .PP --link-target=DN

                            Delete this key credential link (a DN)
                          .RE
                          .PP --fingerprint=HH:HH:..

                                Delete the key credential link with this key fingerprint
                              .RE
                              .PP --all

                                    Delete all key credential links
                                  .RE
                                  .PP -n, --dry-run

                                        Do nothing but print what would happen
                                      .RE

                            user keytrust view username [options]

                                View a user's key credential links. This can be used to find a link's fingerprint and target DN for . The --verbose includes more, probably useless, information.
                                      .PP -h, --help

                                            show this help message and exit
                                          .RE
                                          .PP -v, --verbose

                                                Be verbose
                                              .RE

                                    user generate-csr username subject_name private_key_filename output_filename [options]

                                            .PP Generate a PEMâencoded Certificate Signing Request for a user.

                                              .PP --private-key-encoding

                                                    Specify which encoding the private key uses. Default is 'auto'.
                                                  .RE
                                                  .PP --private-key-pass

                                                        Provide a password to decrypt the private key.
                                                      .RE

  vampire [options] domain

    .PP Join and synchronise a remote AD domain to the local server. Please note that samba-tool vampire is deprecated, please use samba-tool domain join instead.

  visualize [options] subcommand

    .PP Produce graphical representations of Samba network state. To work out what is happening in a replication graph, it is sometimes helpful to use visualisations.
    .PP There are two subcommands, two graphical modes, and (roughly) two modes of operation with respect to the location of authority.
    .sp
MODES OF OPERATION
        .PP samba-tool visualize ntdsconn

                        Looks at NTDS connections.
                        .RE
            .PP samba-tool visualize reps

                    Looks at repsTo and repsFrom objects.
                    .RE
                .PP samba-tool visualize uptodateness

                        Looks at replication lag as shown by the uptodateness vectors.
                        .RE
                    .RE
                    .sp
                GRAPHICAL MODES
                        .PP --distance

                                        Distances between DCs are shown in a matrix in the terminal.
                                        .RE
                            .PP --dot

                                            Generate Graphviz dot output (for ntdsconn and reps modes). When viewed using dot or xdot, this shows the network as a graph with DCs as vertices and connections edges. Certain types of degenerate edges are shown in different colours or line-styles.
                                            .RE
                                .PP --xdot

                                                Generate Graphviz dot output as with [--dot] and attempt to view it immediately using /usr/bin/xdot.
                                                .RE
                                    .RE
                                    .PP -r

                                            Normally, samba-tool talks to one database; with the [-r] option attempts are made to contact all the DCs known to the first database. This is necessary for samba-tool visualize uptodateness and for samba-tool visualize reps because the repsFrom/To objects are not replicated, and it can reveal replication issues in other modes.
                                                    .RE

  help

Gives usage information.

VERSION

    .PP This man page is complete for version 4.24.0 of the Samba suite.

AUTHOR

    .PP The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed.