SAMBA-TOOL(8)

๐Ÿ‘‘ SAMBA-TOOL โ€” System Administration tools ๐Ÿ‘‘

okay so hi bestie ๐Ÿ’– you have found the manual page for samba-tool, section 8, System Administration tools. Yes the header line says SAMBA-TOOL(8) up top and "System Administration tools" on the right, that's just how man pages dress themselves, it's their whole thing. โœจ

This is THE main Samba administration tool. Sit down, grab a strawberry ๐Ÿ“, we're gonna go through every single flag together, no skimming, no skipping, periodt.


โœจ NAME โœจ

samba-tool โ€” Main Samba administration tool. ๐Ÿ’…

That's it. That's the whole name section. Short, iconic, no notes.


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

samba-tool [-h] [-W myworkgroup] [-U user] [-d debuglevel] [-V]

look at her, so compact ๐Ÿ˜ญ this is the tiny little shape of the tool before you go off and use one of the like a hundred sub-commands. Every sub-command has its own options btw, this is just the common ones riding up top.


๐ŸŒธ DESCRIPTION ๐ŸŒธ

This tool is part of the samba(7) suite. ๐Ÿซถ

Translation for the besties: it's the admin tool that comes with Samba. If Samba is the whole vibe, samba-tool is the group chat where you actually get stuff done (creating users, computers, moving things around, the whole main-character arc ๐Ÿ‘‘).


๐ŸŽ€ OPTIONS ๐ŸŽ€

okay so real talk: samba-tool is not one tool, it's a whole collection of sub-commands, and each sub-command has its own set of options. The ones listed in this section are the ones that are common across several sub-commands, so learn these once and you're basically set. ๐Ÿฆ‹

  • -h, --help โ€” Show a help message and exit. That's it, that's the whole thing, free hand-holding bestie ๐Ÿ’–
  • -r REALM, --realm=REALM โ€” Set the realm for the domain.
โš ๏ธ Heads up: specifying this parameter here will override the realm parameter in the /etc/samba/smb.conf file. Your config file is not the boss of you right now, the command line is. ๐Ÿ’…
  • --simple-bind-dn=DN โ€” DN to use for a simple bind.
  • --password โ€” Specify the password on the commandline.

bestie, be cautious about this one. 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. (race = there's a tiny window where it could still be visible, so don't go thinking this is a security blanket.)

  • -U [DOMAIN\]USERNAME[%PASSWORD], --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=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. Yeah. Again. The command line simply does not care about your config file, and honestly? Respect. ๐Ÿ’…
  • -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. (silently. no warning. it just moves on with its life ๐Ÿ™ˆ)

  • --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 filename, --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! ๐Ÿ™ˆ๐Ÿ”’

  • -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.

  • tdb://PATH โ€” PATH is the location of a TDB database.
  • mdb://PATH โ€” PATH is the location of an LMDB database.
  • 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. ๐Ÿฆ‹
  • ldap://HOSTNAME, ldaps://HOSTNAME โ€” The LDB backend is the named ldap server. ldaps:// wraps the connection in TLS. ๐Ÿ”
  • ldapi://SOCKET โ€” The backend server is a local ldap server using a unix domain socket.
  • --color=always|never|auto โ€” use colour if available (default: auto).

yes this one shows up twice in the original man page, we don't make the rules, we just report them faithfully ๐Ÿ™ˆ The fuller version right below says:

  • --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. ๐Ÿ’€ she said "I have a colour palette" and then wore greyscale to the function. iconic honestly.

  • --ipaddress=IPADDRESS โ€” IP address of the server.
  • -s FILE, --configfile=FILE โ€” Use this smb.conf configuration file. ๐Ÿ“‚
  • -V, --version โ€” Display the version number and exit.
  • -d level, --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 ๐ŸŽ€

okay so here's the fun part โ€” the actual things you can do. Buckle up bestie, this list is long and we are going through all of it. ๐Ÿงš

computer

Manage computer accounts. ๐Ÿ’ป

computer add computername [options]

Add a new computer to the Active Directory Domain. ๐ŸŽ‰

The new computer name specified on the command is the sAMAccountName, with or without the trailing dollar sign. (yes the $ is optional, she's flexible like that)

  • --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'.
  • --description=DESCRIPTION โ€” The new computer's description.
  • --ip-address=IP_ADDRESS_LIST โ€” IPv4 address for the computer's A record, or IPv6 address for AAAA record, can be provided multiple times. ๐Ÿ”
  • --service-principal-name=SERVICE_PRINCIPAL_NAME_LIST โ€” Computer's Service Principal Name, can be provided multiple times. ๐Ÿ”
  • --prepare-oldjoin โ€” Prepare enabled machine account for oldjoin mechanism.

computer create computername [options]

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. ๐Ÿซถ

aka: legacy bestie, still invited to the party, but the cool kids use add.

computer delete computername [options]

Delete an existing computer account. ๐Ÿ’€

The computer name specified on the command is the sAMAccountName, with or without the trailing dollar sign.

computer edit computername

Edit a computer AD object. โœ๏ธ

The computer name specified on the command is the sAMAccountName, with or without the trailing dollar sign.

  • --editor=EDITOR โ€” Specifies the editor to use instead of the system default, or vi if no system default is set.

computer list

List all computers. ๐Ÿ“‹

computer move computername new_parent_dn [options]

This command moves a computer account into the specified organizational unit or container. ๐Ÿ“ฆ

The computername specified on the command is the sAMAccountName, with or without the trailing dollar sign.

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

computer show computername [options]

Display a computer AD object. ๐Ÿ‘€

The computer name specified on the command is the sAMAccountName, with or without the trailing dollar sign.

  • --attributes=USER_ATTRS โ€” Comma separated list of attributes, which will be printed.

computer keytrust

Manage Key Credential Links for a computer. ๐Ÿ”‘

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. ๐Ÿ”

and that's where part one leaves us bestie, more coming โ€” don't go anywhere ๐Ÿ’–

The second argument is a filename, and it's gotta point at a 2048 bit RSA key (or a certificate carrying that key around like an emotional support item) in PEM or DER format. Default vibe: we auto-detect the encoding format for you, but you can try to override that with the --encoding option. Other types of public key? Not supported, bestie, sorry. Though the --force option exists if you wanna add a non-2048 bit key anyway. ๐Ÿ’…

  • --link-target=DN โ€” link to this DN (default: the computer's DN)
  • --encoding=ENCODING โ€” key format, either pem, der, or auto. Default is auto, which is lowkey gonna detect the correct format in all circumstances. โœจ
  • --force โ€” proceed with operations that seem ill-fated ๐Ÿ’€

๐Ÿ’… computer keytrust delete computername [options]

Delete a key-credential-link.

Okay so you can pick which link to delete in a few different ways. --all deletes all key credential links for the computer (and ngl, often there'll only be one anyway). --link-target selects a link based on the DN targeted by that link. --fingerprint selects a link based on the key fingerprint โ€” and that's the SHA256 of the DER-encoded key material, written out as hex-pairs separated by colons. Peep computer keytrust view if you want a list of links plus their fingerprints. ๐Ÿ‘€

If you use more than one of --link-target, --fingerprint, and --all at the same time, then links matched by any of them will be deleted. Periodt.

The --dry-run option stops links from being deleted and instead shows you what would happen if you left it out.

  • --link-target=DN โ€” delete this key credential link (a DN)
  • --fingerprint=HH:HH:.. โ€” delete the key credential link with this key fingerprint
  • --all โ€” delete all key credential links
  • -n, --dry-run โ€” do nothing but print what would happen

๐Ÿฆ‹ computer keytrust view computername [options]

View a computer's key credential links. This is how you find a link's fingerprint and target DN. The --verbose includes more, probably useless, information. ๐Ÿ™ˆ

  • -h, --help โ€” show this help message and exit
  • -v, --verbose โ€” be verbose

๐ŸŽ€ computer generate-csr computername

   computer generate-csr computername
            subject_name      private_key_filename      output_filename
       [options]"

Generate a PEMโ€‘encoded Certificate Signing Request for a computer. ๐Ÿ’–

  • --private-key-encoding โ€” specify which encoding the private key uses. Default is 'auto'.
  • --private-key-pass โ€” provide a password to decrypt the private key.

๐ŸŒธ contact

Manage contacts.

๐Ÿ’– contact add [contactname] [options]

Add a new contact to the Active Directory Domain.

So the name of your new contact can come from the first argument 'contactname', or from the --given-name, --initial and --surname arguments. If you don't hand over a 'contactname', the contact's name gets built by smooshing together the given-name, initials and surname. Every single one of those arguments is optional. And a dot ('.') gets appended to the initials automatically. slay. โœจ

  • --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.
  • --description=DESCRIPTION โ€” the new contact's description.
  • --surname=SURNAME โ€” contact's surname.
  • --given-name=GIVEN_NAME โ€” contact's given name.
  • --initials=INITIALS โ€” contact's initials.
  • --display-name=DISPLAY_NAME โ€” contact's display name.
  • --job-title=JOB_TITLE โ€” contact's job title.
  • --department=DEPARTMENT โ€” contact's department.
  • --company=COMPANY โ€” contact's company.
  • --mail-address=MAIL_ADDRESS โ€” contact's email address.
  • --internet-address=INTERNET_ADDRESS โ€” contact's home page.
  • --telephone-number=TELEPHONE_NUMBER โ€” contact's phone number.
  • --mobile-number=MOBILE_NUMBER โ€” contact's mobile phone number.
  • --physical-delivery-office=PHYSICAL_DELIVERY_OFFICE โ€” contact's office location.

๐ŸŒˆ contact create [contactname] [options]

Add a new contact. This is literally just a synonym for the samba-tool contact add command and it only exists for compatibility reasons. Please use samba-tool contact add instead, bestie. ๐Ÿซถ

๐Ÿ’œ contact delete contactname [options]

Delete an existing contact.

The contactname you pass on the command is the common name or the distinguished name of the contact object. And that distinguished name can be given with or without the domainDN component. ๐Ÿ‘

โญ contact edit contactname

Modify a contact AD object.

The contactname you pass on the command is the common name or the distinguished name of the contact object, and again that DN can come with or without the domainDN component.

  • --editor=EDITOR โ€” specifies the editor to use instead of the system default, or 'vi' if no system default is set.

๐Ÿ“ contact list [options]

List all contacts.

  • --full-dn โ€” display contact's full DN instead of the name.

๐Ÿงš contact move contactname new_parent_dn [options]

This command moves a contact into the specified organizational unit or container. ๐Ÿ“ฆ

The contactname you pass on the command is the common name or the distinguished name of the contact object, and the DN can be given with or without the domainDN component.

๐Ÿ’ซ contact show contactname [options]

Display a contact AD object.

The contactname you pass on the command is the common name or the distinguished name of the contact object โ€” with or without the domainDN component, your call.

  • --attributes=CONTACT_ATTRS โ€” comma separated list of attributes, which will be printed.

๐Ÿ‘‘ contact rename contactname [options]

Rename a contact and related attributes.

This one lets you set the contact's name related attributes. The contact's CN gets renamed automatically, and the new CN is made up by combining the given-name, initials and surname. A dot ('.') gets appended to the initials automatically, if required. Wanna specify the new CN yourself? Use the --force-new-cn option. Wanna undo it? --reset-cn. no cap. ๐Ÿ’…

Use an empty attribute value to remove the specified attribute.

The contact name specified on the command is the CN.

  • --surname=SURNAME โ€” new surname.
  • --given-name=GIVEN_NAME โ€” new given name.
  • --initials=INITIALS โ€” new initials.
  • --force-new-cn=NEW_CN โ€” specify a new CN (RDN) instead of using a combination of the given name, initials and surname.
  • --reset-cn โ€” set the CN to the default combination of given name, initials and surname.
  • --display-name=DISPLAY_NAME โ€” new display name.
  • --mail-address=MAIL_ADDRESS โ€” new email address.

๐Ÿ” dbcheck

Check the local AD database for errors. very giving "let me just double check that real quick". ๐Ÿ”Ž


๐ŸŽ€ delegation

Manage Delegations.

โœจ delegation add-principal accountname principal [options]

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

๐Ÿฆ‹ delegation del-principal accountname principal [options]

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

๐Ÿ’– delegation add-service accountname principal [options]

Add a service principal as msDS-AllowedToDelegateTo.

๐ŸŒธ delegation del-service accountname principal [options]

Delete a service principal as msDS-AllowedToDelegateTo.

๐Ÿ’œ delegation for-any-protocol accountname [(on|off)] [options]

Set/unset UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION (S4U2Proxy) for an account.

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

Set/unset UF_TRUSTED_FOR_DELEGATION for an account.

๐Ÿ“ delegation show accountname [options]

Show the delegation setting of an account.


๐ŸŒˆ dns

Manage Domain Name Service (DNS).

๐Ÿ’… dns add server zone name A|AAAA|PTR|CNAME|NS|MX|SRV|TXT data

Add a DNS record.

  • --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. ๐Ÿ˜Œ

๐Ÿงš dns cleanup server name

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.

Example: samba-tool dns cleanup dc1 computer.samdom.test.site

๐Ÿ’ซ dns delete server zone name A|AAAA|PTR|CNAME|NS|MX|SRV|TXT data

Delete a DNS record.

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

Query a name.

๐Ÿ”ฅ dns roothints server [name] [options]

Query root hints.

โญ dns serverinfo server [options]

Query server information.

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

Update a DNS record.

๐Ÿฆ‹ dns zonecreate server zone [options]

Create a zone.

๐Ÿ’œ dns zonedelete server zone [options]

Delete a zone.

๐ŸŒธ dns zoneinfo server zone [options]

Query zone information.

๐Ÿ“ dns zonelist server [options]

List zones.

โœจ dns zoneoptions server zone [options]

Manipulate aging options. This is useful in zones using dynamic DNS.

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. ๐Ÿ˜ญ

  • -n, --dry-run โ€” do not actually change anything, but show what would happen.
  • --client-version=w2k|dotnet|longhorn โ€” Windows client protocol version. The default is longhorn, which is probably what you want.
  • --mark-old-records-static=YYYY-MM-DD โ€” mark records older than the specified date as static.
  • --mark-records-static-regex=REGEXP โ€” mark records that match the given perl-compatible regular expression as static.
  • --mark-records-dynamic-regex=REGEXP โ€” mark records that match the given perl-compatible regular expression as dynamic.
  • --aging=0|1 โ€” --aging=1 to enable aging for this zone. --aging=0 to disable aging for this zone.
  • --norefreshinterval=HOURS โ€” avoid further refreshes for this long after a dynamic update. Set to zero to use the default.
  • --refreshinterval=HOURS โ€” dynamic refresh interval in hours (0: use default)

๐Ÿ‘‘

๐Ÿ‘‘ domain

Manage Domain.

๐Ÿ’– domain backup

Create or restore a backup of the domain.

๐ŸŒˆ domain backup offline

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

๐Ÿฆ‹ domain backup online

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

๐Ÿ’œ domain backup rename

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

โญ domain backup restore

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

๐ŸŽ€ domain auth policy

Manage authentication policies.

โœจ domain auth policy list

List authentication policies on the domain.

  • -H, --URL โ€” LDB URL for database or target server.
  • --json โ€” view authentication policies as JSON instead of a list.

domain auth policy view ๐Ÿ‘€

Wanna peek at an authentication policy that lives on the domain? This is the vibe. โœจ

  • -H, --URL โ€” the LDB URL for the database or the target server. that's your "where am I even looking" knob ๐Ÿ—บ๏ธ
  • --name โ€” the name of the authentication policy you wanna view. required, bestie, no name no view ๐Ÿ™…โ€โ™€๏ธ

domain auth policy create ๐ŸŽ€

Okay so you wanna make authentication policies on the domain. So much power, use it wisely. ๐Ÿ‘‘

  • -H, --URL โ€” LDB URL for the database or the target server ๐ŸŒธ
  • --name โ€” name of the authentication policy (required) โœจ
  • --description โ€” an optional lil description for the authentication policy ๐Ÿ’ฌ
  • --protect โ€” protect the authentication policy from accidental deletion ๐Ÿ›ก๏ธ
cannot be used together with --unprotect. pick a lane.
  • --unprotect โ€” unprotect the authentication policy from accidental deletion ๐Ÿซฃ
cannot be used together with --protect. also pick a lane.
  • --audit โ€” only audit the authentication policy, don't enforce ๐Ÿ‘€
cannot be used together with --enforce.
  • --enforce โ€” enforce the authentication policy, no more just-watching ๐Ÿ˜ค
cannot be used together with --audit.
  • --strong-ntlm-policy โ€” Strong NTLM Policy. the values are Disabled, Optional, Required ๐Ÿ’ช
  • --user-tgt-lifetime-mins โ€” Ticket-Granting-Ticket lifetime for user accounts ๐ŸŽซ
  • --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 ๐Ÿ”“
  • --user-allowed-to-authenticate-from โ€” the 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)}))
  • --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)}))
  • --service-tgt-lifetime-mins โ€” Ticket-Granting-Ticket lifetime for service accounts ๐ŸŽŸ๏ธ
  • --service-allow-ntlm-auth โ€” allow NTLM network authentication when the service is restricted to selected devices ๐Ÿ”‘
  • --service-allowed-to-authenticate-from โ€” the 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)}))
  • --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)}))
  • --computer-tgt-lifetime-mins โ€” Ticket-Granting-Ticket lifetime for computer accounts ๐Ÿ’ป
  • --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)}))

domain auth policy modify ๐Ÿ”ง

Modify authentication policies on the domain, glow-up edition. The same options apply as for domain auth policy create โ€” yes, all of them, we're not retyping the whole list, go scroll up bestie ๐Ÿ˜Œ


domain auth policy delete ๐Ÿ’€

Delete authentication policies on the domain. gone, reduced to atoms.

  • -H, --URL โ€” LDB URL for the database or the target server ๐ŸŒธ
  • --name โ€” name of the authentication policy to delete (required) ๐Ÿ—‘๏ธ
  • --force โ€” force the authentication policy delete even if it is protected ๐Ÿ˜ˆ it's giving "I said what I said"

domain auth policy user-allowed-to-authenticate-from set ๐Ÿฆ‹

Set the user-allowed-to-authenticate-from property by scenario. scenario-mode, no raw SDDL required โœจ

  • -H, --URL โ€” LDB URL for the database or the target server ๐ŸŒˆ
  • --name โ€” name of the authentication policy ๐Ÿท๏ธ
  • --by-group=GROUP โ€” the user is allowed to authenticate if the device they authenticate from is assigned and granted membership of a given GROUP ๐Ÿ‘ฅ
  • --silo=SILO โ€” the user is allowed to authenticate if the device they authenticate from is assigned and granted membership of a given SILO ๐Ÿ›๏ธ

domain auth policy user-allowed-to-authenticate-to set ๐ŸŒธ

Set the user-allowed-to-authenticate-to property by scenario. ๐Ÿ’ซ

  • -H, --URL โ€” LDB URL for the database or the target server ๐Ÿ—บ๏ธ
  • --name โ€” name of the authentication policy ๐Ÿท๏ธ
  • --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 ๐Ÿ‘ฅ
  • --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 ๐Ÿ›๏ธ

domain auth policy service-allowed-to-authenticate-from set ๐Ÿ–ฅ๏ธ

Set the service-allowed-to-authenticate-from property by scenario. ๐ŸŽ€

  • -H, --URL โ€” LDB URL for the database or the target server ๐ŸŒธ
  • --name โ€” name of the authentication policy ๐Ÿท๏ธ
  • --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 ๐Ÿ‘ฅ
  • --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 ๐Ÿ›๏ธ

domain auth policy service-allowed-to-authenticate-to set ๐Ÿงš

Set the service-allowed-to-authenticate-to property by scenario. ๐Ÿ’…

  • -H, --URL โ€” LDB URL for the database or the target server ๐ŸŒˆ
  • --name โ€” name of the authentication policy ๐Ÿท๏ธ
  • --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 ๐Ÿ‘ฅ
  • --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 ๐Ÿ›๏ธ

domain auth policy computer-allowed-to-authenticate-to set ๐Ÿ’ป

Set the computer-allowed-to-authenticate-to property by scenario. โœจ

  • -H, --URL โ€” LDB URL for the database or the target server ๐Ÿ—บ๏ธ
  • --name โ€” name of the authentication policy ๐Ÿท๏ธ
  • --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 ๐Ÿ‘ฅ
  • --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 ๐Ÿ›๏ธ

domain auth silo ๐Ÿ›๏ธ

Manage authentication silos. the silo era has begun, no cap.


domain auth silo list ๐Ÿ“œ

List authentication silos on the domain.

  • -H, --URL โ€” LDB URL for the database or the target server ๐ŸŒธ
  • --json โ€” view authentication silos as JSON instead of a list ๐Ÿงพ (for the machine besties)

domain auth silo view ๐Ÿ‘€

View an authentication silo on the domain.

  • -H, --URL โ€” LDB URL for the database or the target server ๐ŸŒˆ
  • --name โ€” name of the authentication silo to view (required) ๐Ÿ™…โ€โ™€๏ธ

domain auth silo create ๐ŸŽ€

Create authentication silos on the domain. manifesting silos โœจ

  • -H, --URL โ€” LDB URL for the database or the target server ๐ŸŒธ
  • --name โ€” name of the authentication silo (required) โœจ
  • --description โ€” an optional description for the authentication silo ๐Ÿ’ฌ
  • --user-authentication-policy โ€” user account authentication policy ๐Ÿ‘ค
  • --service-authentication-policy โ€” managed service account authentication policy ๐Ÿ–ฅ๏ธ
  • --computer-authentication-policy โ€” computer authentication policy ๐Ÿ’ป
  • --protect โ€” protect the authentication silo from accidental deletion ๐Ÿ›ก๏ธ
cannot be used together with --unprotect.
  • --unprotect โ€” unprotect the authentication silo from accidental deletion ๐Ÿซฃ
cannot be used together with --protect.
  • --audit โ€” only audit silo policies ๐Ÿ‘€
cannot be used together with --enforce.
  • --enforce โ€” enforce silo policies ๐Ÿ˜ค
cannot be used together with --audit.

domain auth silo modify ๐Ÿ”ง

Modify authentication silos on the domain. same energy, new settings.

  • -H, --URL โ€” LDB URL for the database or the target server ๐ŸŒˆ
  • --name โ€” name of the authentication silo (required) ๐Ÿท๏ธ
  • --description โ€” an optional description for the authentication silo ๐Ÿ’ฌ
  • --user-authentication-policy โ€” user account authentication policy ๐Ÿ‘ค
  • --service-authentication-policy โ€” managed service account authentication policy ๐Ÿ–ฅ๏ธ
  • --computer-authentication-policy โ€” computer authentication policy ๐Ÿ’ป
  • --protect โ€” protect the authentication silo from accidental deletion ๐Ÿ›ก๏ธ
cannot be used together with --unprotect.
  • --unprotect โ€” unprotect the authentication silo from accidental deletion ๐Ÿซฃ
cannot be used together with --protect.
  • --audit โ€” only audit silo policies ๐Ÿ‘€
cannot be used together with --enforce.
  • --enforce โ€” enforce silo policies ๐Ÿ˜ค
cannot be used together with --audit.

domain auth silo delete ๐Ÿ’€

Delete authentication silos on the domain. rip bozo ๐Ÿชฆ

  • -H, --URL โ€” LDB URL for the database or the target server ๐ŸŒธ
  • --name โ€” name of the authentication silo to delete (required) ๐Ÿ—‘๏ธ
  • --force โ€” force the authentication silo delete even if it is protected ๐Ÿ˜ˆ

domain auth silo member grant ๐ŸŽŸ๏ธ

Grant a member access to an authentication silo. come on in, the silo's lovely ๐Ÿซถ

  • -H, --URL โ€” LDB URL for the database or the target server ๐ŸŒˆ
  • --name โ€” name of the authentication silo (required) ๐Ÿ›๏ธ
  • --member โ€” the member to grant access to the silo (DN or account name) ๐Ÿ‘ฅ

domain auth silo member list ๐Ÿ“œ

List the members in an authentication silo. who's in the group chat ๐Ÿ’ฌ

  • -H, --URL โ€” LDB URL for the database or the target server ๐ŸŒธ
  • --name โ€” name of the authentication silo (required) ๐Ÿ›๏ธ
  • --json โ€” view members as JSON instead of a list ๐Ÿงพ

domain auth silo member revoke ๐Ÿšช

Revoke a member from an authentication silo. it's not you it's the policy ๐Ÿ’”

  • -H, --URL โ€” LDB URL for the database or the target server ๐ŸŒˆ
  • --name โ€” name of the authentication silo (required) ๐Ÿ›๏ธ
  • --member โ€” the member to revoke from the silo (DN or account name) ๐Ÿ‘ค

domain claim claim-type list ๐Ÿ—‚๏ธ

List claim types on the domain. claims, but make it a list โœจ

  • -H, --URL โ€” LDB URL for the database or the target server ๐ŸŒธ
  • --json โ€” view claim types as JSON instead of a list ๐Ÿงพ

โœจ domain claim claim-type view

Bestie this one is a lil peek-a-boo: it shows you one single claim type on the domain. Just the one. Very demure.

  • -H, --URL โ€” the LDB URL for the database or the target server.
  • --name โ€” display name of the claim type you wanna view. It's required, no skipping ๐Ÿ’…

๐ŸŽ€ domain claim claim-type create

Now we're making claim types on the domain. Main character behavior fr.

  • -H, --URL โ€” LDB URL for the database or the target server.
  • --attribute โ€” the attribute of the claim type you're creating. Required bestie, don't forget it.
  • --class โ€” the object classes to set the claim type to.

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

  • --name โ€” optional display name, or it just uses the attribute name instead. Lazy but valid.
  • --description โ€” optional description, or it uses the one from the attribute.
  • --enable โ€” turn the claim type ON.
Can't be used together with --disable. Pick a lane, babe.
  • --disable โ€” turn the claim type OFF.
Cannot be used together with --enable.
  • --protect โ€” protect the claim type from accidental deletion. Bubble wrap for your config ๐Ÿซถ
Cannot be used together with --unprotect.
  • --unprotect โ€” unprotect the claim type from accidental deletion.
Cannot be used together with --protect.

๐Ÿฆ‹ domain claim claim-type modify

Same energy, but for changing claim types that already exist.

  • -H, --URL โ€” LDB URL for the database or the target server.
  • --name โ€” display name of the claim type you're modifying. Required.
  • --class โ€” object classes to set the claim type to.

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

  • --description โ€” set the claim type's description.
  • --enable โ€” enable the claim type.
Cannot be used together with --disable.
  • --disable โ€” disable the claim type.
Cannot be used together with --enable.
  • --protect โ€” protect it from accidental deletion.
Cannot be used together with --unprotect.
  • --unprotect โ€” unprotect it from accidental deletion.
Cannot be used together with --protect.

๐Ÿ’€ domain claim claim-type delete

The dramatic one. It deletes claim types off the domain. Gone. Poof.

  • -H, --URL โ€” LDB URL for the database or the target server.
  • --name โ€” display name of the claim type to delete. Required โ€” you have to say which one you're yeeting.
  • --force โ€” forces the delete even if the claim type is protected. Break the glass, bestie.

๐ŸŒˆ domain claim value-type list

Lists the claim value types on the domain. Window shopping โœจ

  • -H, --URL โ€” LDB URL for the database or the target server.
  • --json โ€” view the claim value types as JSON instead of a plain list. For the girlies who pipe things into jq.

๐Ÿ“ domain claim value-type view

Views a single claim value type on the domain.

  • -H, --URL โ€” LDB URL for the database or the target server.
  • --name โ€” display name of the claim value type to view. Required.

๐Ÿ‘‘

domain classicupgrade [options] classic_smb_conf

Upgrade from a Samba classic (NT4-like) database all the way to a Samba AD DC database. Glow-up of the century, no cap.


domain dcpromo dnsdomain [DC|RODC] [options]

Promotes an existing domain member or an NT4 PDC to an AD DC. Level up ๐Ÿ’…


๐Ÿ™ˆ domain demote

Demotes ourselves from the role of domain controller. Sometimes you gotta step down from the throne, it's giving humble era.


domain exportkeytab keytab [options]

Dumps the Kerberos keys of the domain straight into a keytab. Handing out the โœจsparkleโœจ to whoever needs it.


domain functionalprep [options]

Prepares a domain for a functional level upgrade. If --functional-level isn't used, it just uses the latest supported version (which is currently 2016).

So there's two whole aspects to this prep, bestie, and they relate to the forest and the domain. By default, both of them run. But if you use either --forest-prep or --domain-prep, only that corresponding preparation happens. And if you use both arguments together? Then all the prep gets done โ€” exactly like when you use neither. Balance ๐ŸŒธ

  • -H, --URL โ€” LDB URL for the database or the target server.
  • --functional-level [2008_R2|2012|2012_R2|2016] โ€” the functional level you're preparing for. The default is 2016.
  • --forest-prep โ€” run forest preparation only (unless --domain-prep is also used).
  • --domain-prep โ€” run domain preparation only (unless --forest-prep is also used).

domain info ip_address [options]

Prints the basic info about a domain and the DC you point it at. Receipts ๐Ÿงพ


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

Joins a domain as either a member or a backup domain controller. Pick your archetype.


๐ŸŽ€ domain kds root-key

Manages Key Distribution Service root keys. The whole KDS root-key world lives under here.


domain kds root-key create [options]

Creates KDS root keys ๐Ÿ”‘

  • -H, --URL โ€” LDB URL for the database or the target server.
  • --use-start-time=["now"|iso8601 or LDIF time string] โ€” the key will be valid from this time onwards.

Valid time formats 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 that optional trailing [+HH:MM[:SS[.ffffff]]] is a timezone offset (like '+00:00' for UTC).

  • --json โ€” output the results in JSON format.

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

Deletes the named KDS root key. Heads up: use samba-tool domain kds root-key list to find the name of the key first, iykyk.

  • -H, --URL โ€” LDB URL for the database or the target server.
  • --name=NAME โ€” the name of the key to delete. It's gonna be a GUID.
  • -v, --verbose โ€” print all attributes (except the secret ones, unless --show secrets is used).
  • --json โ€” output results in JSON format.

domain kds root-key list [options]

Lists KDS root keys. The newest keys come first โ€” fresh to oldest, like your camera roll ๐ŸŒธ

  • -H, --URL โ€” LDB URL for the database or the target server.
  • --show-secrets โ€” print secret or potentially sensitive attributes, namely msKds-RootKeyData and msKds-SecretAgreementParam. Careful with these, bestie.
  • -v, --verbose โ€” print more attributes (but not the secret ones, unless --show secrets is also used).
  • --json โ€” output results in JSON format.

domain kds root-key view [options]

Views a KDS root key. The default output is basically what samba-tool domain kds root-key list --verbose gives you, except only one key shows up. You pick which one with --latest for the most recent key, or --name to select a key by name.

  • -H, --URL โ€” LDB URL for the database or the target server.
  • --latest โ€” view the most recent root key.
  • --name=NAME โ€” the name of the key to view. It'll be a GUID.
  • -v, --verbose โ€” print all attributes (except secret ones, unless --show secrets is used). This even includes attributes that are only useful for LDB bookkeeping. The receipts of receipts.
  • --json โ€” output results in JSON format.

๐Ÿซถ domain leave [options]

Run this on a domain member and it'll make it leave the domain. It's giving โœจ*we're done here*โœจ.

To remove a domain server from the domain, you first need samba-tool domain demote. Don't skip steps, babe.
  • --keep-account โ€” disable the machine account instead of deleting it.

domain level show|raise options [options]

Shows or raises domain and forest function levels.


domain passwordsettings set options [options]

Sets password settings, including complexity requirements, lockout policy, history length, minimum password length, and minimum and maximum password age on a Samba AD DC server.

Use against a Windows DC is possible, but group policy will override it. So like... do with that what you will.
  • -H URL, --URL=URL โ€” LDB URL for database or target server
  • -q, --quiet โ€” be quiet ๐Ÿคซ
  • --complexity=COMPLEXITY โ€” the password complexity (on | off | default). Default is 'on'.
  • --store-plaintext=STORE_PLAINTEXT โ€” store plaintext passwords where accounts have 'store passwords with reversible encryption' set (on | off | default). Default is 'off'.
  • --history-length=HISTORY_LENGTH โ€” the password history length (integer | default). Default is 24.
  • --min-pwd-length=MIN_PWD_LENGTH โ€” the minimum password length (integer | default). Default is 7.
  • --min-pwd-age=MIN_PWD_AGE โ€” the minimum password age (number of days | default). Default is 1.
  • --max-pwd-age=MAX_PWD_AGE โ€” the maximum password age (number of days | default). Default is 43.
  • --account-lockout-duration=ACCOUNT_LOCKOUT_DURATION โ€” how long an account stays locked out after it blows past the bad-password-attempt limit (number of minutes | default). Default is 30 mins.
  • --account-lockout-threshold=ACCOUNT_LOCKOUT_THRESHOLD โ€” how many bad password attempts are allowed before the account gets locked out (integer | default). Default is 0 (never lock out).
  • --reset-account-lockout-after=RESET_ACCOUNT_LOCKOUT_AFTER โ€” once this much time has elapsed, the recorded number of attempts restarts from zero (integer | default). Default is 30.

domain passwordsettings show options [options]

Displays the current password settings for the domain. The tea โ˜•

  • -H URL, --URL=URL โ€” LDB URL for database or target server

๐Ÿ‘‘ domain passwordsettings pso

Manages fine-grained Password Settings Objects (PSOs). Fancy, granular, iconic.

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

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

domain passwordsettings pso create pso-name precedence [options]

Creates a new Password Settings Object (PSO).

domain passwordsettings pso delete pso-name [options]

Deletes a Password Settings Object (PSO).

domain passwordsettings pso list [options]

Lists all Password Settings Objects (PSOs).

domain passwordsettings pso set pso-name [options]

Modifies a Password Settings Object (PSO).

domain passwordsettings pso show user-name [options]

Displays a Password Settings Object (PSO).

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

Displays the Password Settings that apply to a user.

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

Updates a PSO to no longer apply to a user or a group. It's not you, it's policy ๐Ÿ’”


โญ domain provision

Promotes an existing domain member or NT4 PDC to an AD DC.


domain schemaupgrade [options]

Upgrades the schema. Glow-up but for your directory structure.

  • -H, --URL โ€” LDB URL for the database or the target server.
  • --schema [2012|2012_R2|2016|2019] โ€” upgrade to this Windows schema level. The default is 2019.
  • --ldf-file โ€” apply the schema changes in this LDIF file, instead of updating to a standard schema level.
  • --base-dir โ€” specify an alternate location to find the schema LDIF files.

domain tombstones expunge NC [NC [...]] [options]
  • -H URL, --URL=URL โ€” LDB URL for database or target server
  • --current-time=YYYY-MM-DD โ€” the current time to evaluate the tombstone lifetime from, expressed as YYYY-MM-DD
  • --tombstone-lifetime=DAYS โ€” number of days a tombstone should be preserved for

๐ŸŒธ domain trust

Domain and forest trust management. The whole trust tree lives here.

domain trust create DOMAIN options [options]

Create a domain or forest trust.

domain trust modify DOMAIN options [options]

Modify a domain or forest trust.

domain trust delete DOMAIN options [options]

Delete a domain trust.

domain trust list options [options]

List domain trusts.

domain trust namespaces [DOMAIN] options [options]

Manage forest trust namespaces.

domain trust show DOMAIN options [options]

Show trusted domain details.

domain trust validate DOMAIN options [options]

Validate a domain trust.


๐Ÿ’œ drs

Manage Directory Replication Services (DRS). Replication girlies rise up.

drs bind

Show DRS capabilities of a server.

drs clone-dc-database dnsdomain

--targetdir=DIR [options]"

okay so drs clone wraps up with a whole vibe-check of options, and remember what we said: this one Replicate an initial clone of domain, but DO NOT JOIN it. (the caps are screaming for a reason, bestie โ€” clone only, no joining ๐Ÿ’€)

  • --server=DC โ€” clone this DC. yeah, this one. your source ๐Ÿซถ
  • --targetdir=TARGETDIR โ€” where to store provision. required, so like, not optional-fr-fr ๐Ÿ˜ญ
  • -q, --quiet โ€” be quiet. shhh. no yapping.
  • --include-secrets โ€” also replicate secret values. the spicy bits ๐Ÿ”
  • --backend-store=BACKENDSTORE โ€” specify the database backend to be used (default is tdb).
  • --backend-store-size=SIZE โ€” specify the size of the backend database, currently only supported by lmdb backends (default is 8 GB).

drs uptodateness [options]

Show uptodateness status. like, how caught-up is everything, on a scale of "slay" to "bestie we need to talk" ๐Ÿ’…

  • -H URL, --URL=URL โ€” LDB URL for database or target server
  • -p PARTITION, --partition=PARTITION โ€” restrict to this partition
  • --json โ€” print data in json format
  • --maximum โ€” print maximum out-of-date-ness only
  • --median โ€” print median out-of-date-ness only
  • --full โ€” print full out-of-date-ness data

drs kcc

Trigger knowledge consistency center run. that's the โœจself-healing topologyโœจ moment, periodt.

drs options

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

drs replicate destination_DC source_DC NC [options]

Replicate a naming context between two DCs. destination first, source second, NC for the naming context. order matters, don't fight me on it ๐Ÿ’œ

drs showrepl

Show replication status. heads up: the [--json] option results in JSON output, and with the [--summary] option it produces very little output when the replication status seems healthy. silent = thriving ๐Ÿฆ‹

dsacl

Administer DS ACLs.

dsacl delete

Delete an access list entry on a directory object.

dsacl get

Print access list on a directory object.

dsacl set

Modify access list on a directory object.


forest

Manage Forest configuration. big-picture stuff, the whole forest, not just one lil tree ๐ŸŒฒ

forest directory_service

Manage directory_service behaviour for the forest.

forest directory_service dsheuristics VALUE

Modify dsheuristics directory_service configuration for the forest.

forest directory_service show

Show current directory_service configuration for the forest.


fsmo

Manage Flexible Single Master Operations (FSMO). the celebrity roles of the AD world, ngl ๐Ÿ‘‘

fsmo seize [options]

Seize the role. dramatic. iconic. sometimes necessary. ๐Ÿ”ฅ

fsmo show

Show the roles.

fsmo transfer [options]

Transfer the role. the polite version ๐ŸŽ€


gpo

Manage Group Policy Objects (GPO).

gpo aclcheck [options]

Create an empty GPO.

Check all GPOs have matching LDAP and DS ACLs.

(yeah, that first line is a little copy-paste gremlin moment, but we report what the page says, no cap.)

  • -H URL, --URL=URL โ€” LDB URL for database or target server

gpo admxload [options]

Loads samba admx files to sysvol.

  • -H URL, --URL=URL โ€” LDB URL for database or target server
  • --admx-dir=ADMX_DIR โ€” directory where admx templates are stored

gpo backup gpo[options]

Backup a GPO.

  • -H H โ€” LDB URL for database or target server
  • --tmpdir=TMPDIR โ€” temporary directory for copying policy files
  • --generalize โ€” generalize XML entities to restore
  • --entities=ENT_FILE โ€” file to export defining XML entities for the restore

gpo create displayname [options]

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.

okay so this command takes a CSE filename as an argument, and registers it for applying policy on the current host. it's not necessary for CSEs which are distributed with the current version of Samba, but it's 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. so like, put it somewhere it can stay, bestie ๐Ÿ˜ญ

  • --machine โ€” whether to register the CSE as Machine policy
  • --user โ€” whether to register the CSE as User policy

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]

Delete GPO.

Delete GPO link from a container.

gpo fetch gpo [options]

Download a GPO.

gpo getinheritance container_dn [options]

Get inheritance flag for a container.

List GPO Links for a container.

gpo list username [options]

List GPOs for an account.

gpo listall

List all GPOs. every single one. the full roster โœจ

gpo listcontainers gpo [options]

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.

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
    }
    ]

Valid class attributes: MACHINE|USER|BOTH. Data arrays are interpreted as bytes.

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.

  • -H H โ€” LDB URL for database or target server
  • --content=CONTENT โ€” JSON file of policy inputs
  • --machine-ext-name=MACHINE_EXTS โ€” a machine extension name to add to gPCMachineExtensionNames
  • --user-ext-name=USER_EXTS โ€” a user extension name to add to gPCUserExtensionNames
  • --replace โ€” replace the existing Group Policies, rather than merging

gpo manage security list gpo [options]

List Samba Security Group Policy from the sysvol.

This command lists security settings from the sysvol that will be applied to winbind clients. These settings only apply to the AD DC.

Example:

samba-tool gpo manage security list {31B2F340-016D-11D2-945F-00C04FB984F9}
  • -H URL, --URL=URL โ€” LDB URL for database or target server

gpo manage security set gpo [options]

Set Samba Security Group Policy to the sysvol.

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.

Example:

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

Possible policies:

  • MaxTicketAge โ€” maximum lifetime for user ticket (hours).
  • MaxServiceAge โ€” maximum lifetime for service ticket in minutes. Defined in minutes.
  • MaxRenewAge โ€” maximum lifetime for user ticket renewal, in minutes.
  • MinimumPasswordAge โ€” minimum password age, in days.
  • MaximumPasswordAge โ€” maximum password age, in days.
  • MinimumPasswordLength โ€” minimum password length, in characters.
  • PasswordComplexity โ€” password must meet complexity requirements. 1 is Enabled, 0 is Disabled.
  • -H URL, --URL=URL โ€” LDB URL for database or target server

List Samba Security Group Policy from the sysvol.

This command lists security settings from the sysvol that will be applied to winbind clients. These settings only apply to the AD DC.

Example:

samba-tool gpo manage security list {31B2F340-016D-11D2-945F-00C04FB984F9}
  • -H URL, --URL=URL โ€” LDB URL for database or target server
nope, bestie, you're not seeing double โ€” that block really is in here twice. we keep it, all of it, no cutting ๐Ÿ’…

gpo manage smb_conf list

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

Example:

samba-tool gpo manage smb_conf list {31B2F340-016D-11D2-945F-00C04FB984F9}
  • -H URL, --URL=URL โ€” LDB URL for database or target server

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.

Example:

samba-tool gpo manage smb_conf set {31B2F340-016D-11D2-945F-00C04FB984F9} 'apply gpo policies' yes
  • -H URL, --URL=URL โ€” LDB URL for database or target server

gpo setinheritance container_dn block|inherit [options]

Set inheritance flag on a container.

Add or Update a GPO link to a container.

gpo removegpo [options]

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

  • -H H โ€” LDB URL for database or target server
  • --content=CONTENT โ€” JSON file of policy inputs
  • --machine-ext-name=MACHINE_EXTS โ€” a machine extension name to remove from gPCMachineExtensionNames
  • --user-ext-name=USER_EXTS โ€” a user extension name to remove from gPCUserExtensionNames
  • --color=always|never|auto โ€” use colour if available (default: auto)

gpo restore displayname backup location [options]

Restore a GPO to a new container.

  • -H H โ€” LDB URL for database or target server
  • --tmpdir=TMPDIR โ€” the temporary directory it uses for copying policy files ๐Ÿ—‚๏ธ
  • --entities=ENTITIES โ€” a file that defines the XML entities to insert into the DOCTYPE header
  • --restore-metadata โ€” keeps the old GPT.INI file and its associated version number, no refreshing bestie ๐Ÿ’พ

gpo show gpo [options] โ€” shows you the info for a GPO.

okay and now the whole gpo manage fam, all of them vibing in the sysvol โœจ:

  • gpo manage symlink list โ€” List VGP Symbolic Link Group Policy from the sysvol
  • gpo manage symlink add โ€” Adds a VGP Symbolic Link Group Policy to the sysvol
  • gpo manage symlink remove โ€” Removes a VGP Symbolic Link Group Policy from the sysvol
  • gpo manage files list โ€” List VGP Files Group Policy from the sysvol
  • gpo manage files add โ€” Add VGP Files Group Policy to the sysvol
  • gpo manage files remove โ€” Remove VGP Files Group Policy from the sysvol
  • gpo manage openssh list โ€” List VGP OpenSSH Group Policy from the sysvol
  • gpo manage openssh set โ€” Sets a VGP OpenSSH Group Policy to the sysvol
  • gpo manage sudoers add โ€” Adds a Samba Sudoers Group Policy to the sysvol.
  • gpo manage sudoers list โ€” List Samba Sudoers Group Policy from the sysvol.
  • gpo manage sudoers remove โ€” Removes a Samba Sudoers Group Policy from the sysvol.
  • gpo manage scripts startup list โ€” List VGP Startup Script Group Policy from the sysvol
  • gpo manage scripts startup add โ€” Adds VGP Startup Script Group Policy to the sysvol
  • gpo manage scripts startup remove โ€” Removes VGP Startup Script Group Policy from the sysvol
  • gpo manage motd list โ€” List VGP MOTD Group Policy from the sysvol.
  • gpo manage motd set โ€” Sets a VGP MOTD Group Policy to the sysvol
  • gpo manage issue list โ€” List VGP Issue Group Policy from the sysvol.
  • gpo manage issue set โ€” Sets a VGP Issue Group Policy to the sysvol
  • gpo manage access add โ€” Adds a VGP Host Access Group Policy to the sysvol
  • gpo manage access list โ€” List VGP Host Access Group Policy from the sysvol
  • gpo manage access remove โ€” Remove a VGP Host Access Group Policy from the sysvol

๐Ÿ‘ฏ group

Manage groups. That's it, that's the whole section.

group add groupname [options]

Create a new AD group. brand new baby group ๐Ÿซถ

group create groupname [options]

Add a new AD group. This one is literally a synonym for the samba-tool group add command and it's only here for compatibility reasons, okay? Please use samba-tool group add instead. no cap ๐Ÿ™

group addmembers groupname members [options]

Add members to an AD group.

group addunixattrs groupname gidnumber [options]

Adds RFC2307 Unix attributes to a group account in the Active Directory domain. The groupname you pass 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.

  • -H URL, --URL=URL โ€” LDB URL for database or target server

group delete groupname [options]

Delete an AD group. bye bestie ๐Ÿ’€

group edit groupname

Edit a group AD object.

  • --editor=EDITOR โ€” specifies the editor to use instead of the system default, or vi if no system default is set.

group list

List all groups.

group listmembers groupname [options]

List all members of the specified AD group.

By default the sAMAccountNames are listed. If no sAMAccountName is available, the CN will be used instead.

  • --full-dn โ€” list the distinguished names instead of the sAMAccountNames.
  • --hide-expired โ€” do not list expired group members.
  • --hide-disabled โ€” do not list disabled group members.

group move groupname new_parent_dn [options]

This command moves a group into the specified organizational unit or container.

The groupname specified on the command is the sAMAccountName.

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

group removemembers groupname members [options]

Remove members from the specified AD group.

group show groupname [options]

Show group object and it's attributes.

group stats [options]

Show statistics for overall groups and group memberships.

group rename groupname [options]

Rename a group and related attributes.

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.

Use an empty attribute value to remove the specified attribute.

The groupname specified on the command is the sAMAccountName.

  • --force-new-cn=NEW_CN โ€” specify a new CN (RDN) instead of using the sAMAccountName.
  • --reset-cn โ€” set the CN to the sAMAccountName.
  • --mail-address=MAIL_ADDRESS โ€” new mail address
  • --samaccountname=SAMACCOUNTNAME โ€” new account name (sAMAccountName/logon name)

ldapcmp URL1 URL2 domain|configuration|schema|dnsdomain|dnsforest [options] โ€” compares two LDAP databases. spot the difference ๐Ÿ”


๐Ÿ” ntacl

Manage NT ACLs.

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

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.

  • --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.
  • --service=SERVICE โ€” specify the name of the smb.conf service to use. This option is required in combination with the --use-s3fs option.
  • --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.
  • --xattr-backend=[native|tdb] โ€” specify the xattr backend type (native fs or tdb).
  • --eadb-file=EADB_FILE โ€” name of the tdb file where attributes are stored.
  • --recursive โ€” set the ACLs for directories and their contents recursively.
  • --follow-symlinks โ€” follow symlinks when --recursive is specified.
  • --verbose โ€” verbosely list files and ACLs which are being processed.

ntacl getdosinfo file [options]

Get DOS info of a file from xattr.

ntacl get file [options]

Get ACLs on a file.

ntacl set acl file [options]

Set ACLs on a file.

ntacl sysvolcheck

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

ntacl sysvolreset

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


๐Ÿข ou

Manage organizational units (OUs).

ou add ou_dn [options]

Add a new organizational unit.

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

  • --description=DESCRIPTION โ€” specify OU's description.

ou create ou_dn [options]

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. same energy as the group one fr fr ๐Ÿ’…

ou delete ou_dn [options]

Delete an organizational unit.

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

  • --force-subtree-delete โ€” delete organizational unit and all children recursively.

ou list [options]

List all organizational units.

  • --full-dn โ€” display DNs including the base DN.

ou listobjects ou_dn [options]

List all objects in an organizational unit.

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

  • --full-dn โ€” display DNs including the base DN.
  • -r|--recursive โ€” list objects recursively.

ou move old_ou_dn new_parent_dn [options]

Move an organizational unit.

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]

Rename an organizational unit.

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


๐Ÿ” processes

List samba server processes.

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. (yes really, check the config file bestie ๐Ÿ™ˆ)

  • --name=NAME โ€” show processes associated with the given name.
  • --pid=PID โ€” show names associated with the PID.

๐ŸงŠ rodc

Manage Read-Only Domain Controller (RODC).

rodc preload SID|DN|accountname [options]

Preload one account for an RODC.


๐Ÿ“œ schema

Manage and query schema.

schema attribute modify attribute [options]

Modify the behaviour of an attribute in schema.

schema attribute show attribute [options]

Display an attribute schema definition.

schema attribute show_oc attribute [options]

Show objectclasses that MAY or MUST contain this attribute.

schema objectclass show objectclass [options]

Display an objectclass schema definition.


๐Ÿง‘โ€๐Ÿ’ผ service-account

Service account management.

service-account list

List service accounts on the domain.

  • -H, --URL โ€” LDB URL for database or target server.
  • --json โ€” view service accounts as JSON instead of a list.

service-account view

View a single service account on the domain.

  • -H, --URL โ€” LDB URL for database or target server.
  • --name โ€” account name of service account to view (required).

service-account create

Create a new service account on the domain.

  • -H, --URL โ€” LDB URL for database or target server.
  • --name โ€” account name of service account (required).
  • --dns-host-name โ€” DNS hostname of this service account (required).
  • --group-msa-membership โ€” optional Group MSA Membership SDDL.
  • --managed-password-interval โ€” managed password refresh interval in days.

service-account modify

Modify an existing service account on the domain.

  • -H, --URL โ€” LDB URL for database or target server.
  • --name โ€” account name of service account (required).
  • --dns-host-name โ€” update DNS hostname of this service account.
  • --group-msa-membership โ€” update Group MSA Membership SDDL.

service-account delete

Delete a service accounts on the domain.

  • -H, --URL โ€” LDB URL for database or target server.
  • --name โ€” account name of service account to delete.

service-account group-msa-membership

Service account Group MSA Membership management.

service-account group-msa-membership show

Display Group MSA Membership for a service account.

  • -H, --URL โ€” LDB URL for database or target server.
  • --name โ€” account name of service account (required).
  • --json โ€” Return as JSON instead of a list. ๐Ÿ“ฆ

โœจ service-account group-msa-membership add โœจ

Add a principal to Group MSA Membership for a service account. ๐Ÿ’–

  • -H, --URL โ€” LDB URL for database or target server. ๐Ÿ”—
  • --name โ€” Account name of service account (required). ๐Ÿ“›
  • --principal โ€” Name, DN or SID of principal to add. ๐Ÿ‘‘

โœจ service-account group-msa-membership remove โœจ

Remove a principal from Group MSA Membership for a service account. ๐Ÿ’”

  • -H, --URL โ€” LDB URL for database or target server. ๐Ÿ”—
  • --name โ€” Account name of service account (required). ๐Ÿ“›
  • --principal โ€” Name, DN or SID of principal to remove. ๐Ÿ—‘๏ธ

๐Ÿš shell ๐Ÿš

Opens an interactive Samba Python shell. โœจ

๐Ÿš shell [options] ๐Ÿš

Opens an interactive Python shell for Samba ldb connection. ๐Ÿ”Œ

  • -H, --URL โ€” LDB URL for database or target server. ๐Ÿ”—

๐ŸŒ sites ๐ŸŒ

Manage sites. ๐Ÿ—บ๏ธ

๐Ÿ“‹ sites list [options] ๐Ÿ“‹

List sites. ๐Ÿ“

  • --json โ€” Output as JSON instead of a list. ๐Ÿ“ฆ

๐Ÿ‘€ sites view site [options] ๐Ÿ‘€

View site details. ๐Ÿ”

โž• sites create site [options] โž•

Create a new site. ๐Ÿ†•

โŒ sites remove site [options] โŒ

Delete an existing site. ๐Ÿ—‘๏ธ

๐Ÿ“‹ sites subnet list site [options] ๐Ÿ“‹

List subnets for a site. ๐Ÿ“ก

  • --json โ€” Output as JSON instead of a list. ๐Ÿ“ฆ

๐Ÿ‘€ sites subnet view subnet [options] ๐Ÿ‘€

View subnet details. ๐Ÿ”

โž• sites subnet create subnet site-of-subnet [options] โž•

Create a new subnet. ๐Ÿ†•

โŒ sites subnet remove subnet [options] โŒ

Delete an existing subnet. ๐Ÿ—‘๏ธ

๐Ÿ”— sites subnet set-site subnet site-of-subnet [options] ๐Ÿ”—

Assign a subnet to a site. ๐Ÿ“Œ

๐ŸŽซ spn ๐ŸŽซ

Manage Service Principal Names (SPN). ๐ŸŽŸ๏ธ

โž• spn add name user [options] โž•

Create a new SPN. โœจ

โŒ spn delete name [user] [options] โŒ

Delete an existing SPN. ๐Ÿ—‘๏ธ

๐Ÿ“‹ spn list user [options] ๐Ÿ“‹

List SPNs of a given user. ๐Ÿ‘ค

๐Ÿงช testparm ๐Ÿงช

Check the syntax of the configuration file. ๐Ÿ“„

โฐ time โฐ

Retrieve the time on a server. ๐Ÿ•ฐ๏ธ

๐Ÿ‘ค user ๐Ÿ‘ค

Manage users. ๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘

โž• user add username [password] โž•

Add a new user to the Active Directory Domain. ๐ŸŽ‰

๐Ÿงฌ user addunixattrs username uid-number [options] ๐Ÿงฌ

Add RFC2307 attributes to a user. ๐Ÿงฉ

This command adds Unix attributes to a user account in the Active Directory domain. โœจ

The username specified on the command is the sAMaccountName. ๐Ÿ“›

You must supply a unique uid. ๐Ÿ”‘

Unix (RFC2307) attributes will be added to the user account. ๐Ÿ’–

If you supply a group id with --gid-number, this will be used for the users Unix gidNumber attribute. ๐Ÿ†”

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. ๐Ÿ‘ฅ

If --unix-home is not supplied, the users Unix home directory will be set to /home/DOMAIN/username. ๐Ÿ 

If --login-shell is not supplied, the users Unix login shell will be set to /bin/sh. ๐Ÿš

If ---gecos is not supplied, the users Unix gecos field will be set to the user's CN attribute. ๐Ÿ“

Add idmap_ldb:use rfc2307 = Yes to the smb.conf on DCs to use these attributes for UID/GID mapping. โš™๏ธ

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. ๐ŸŒ

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. ๐Ÿ‘‘

The users Unix ID will be set to 10001, provided this ID isn't already in use. ๐Ÿ†”

Example2:

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

Example2 shows how to add RFC2307 attributes to a domain enabled user account. ๐ŸŽ‰

The users Unix ID will be set to 10002, provided this ID isn't already in use. ๐Ÿ†”

The users gidNumber attribute will be set to 10001. ๐Ÿ†”

The users Unix home directory will be set to /home/user2. ๐Ÿ 

Example3:

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

Example3 shows how to add RFC2307 attributes to a domain enabled user account. ๐ŸŽ‰

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. ๐Ÿ“

  • -H URL, --URL=URL โ€” LDB URL for database or target server ๐Ÿ”—
  • --gid-number=GROUP_ID โ€” User's Unix/RFC2307 GID ๐Ÿ†”
  • --unix-home=DIR โ€” User's Unix/RFC2307 home directory ๐Ÿ 
  • --login-shell=SHELL โ€” User's Unix/RFC2307 login shell ๐Ÿš
  • --gecos=GECOS โ€” User's Unix/RFC2307 GECOS field ๐Ÿ“
  • --uid=USER_ID โ€” User's Unix/RFC2307 user id ๐Ÿ†”

๐Ÿง‘โ€๐Ÿ’ป user create username [password] ๐Ÿง‘โ€๐Ÿ’ป

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] ๐Ÿ—‘๏ธ

Delete an existing user account. ๐Ÿ˜ข

๐Ÿšซ user disable username ๐Ÿšซ

Disable a user account. ๐Ÿ”’

  • --remove-supplemental-groups โ€” Remove user from all groups, but keep the primary group. ๐Ÿ‘ฅ

โœ๏ธ user edit username โœ๏ธ

Edit a user account AD object. ๐Ÿ“

  • --editor=EDITOR โ€” Specifies the editor to use instead of the system default, or vi if no system default is set. ๐Ÿ“Ÿ

โœ… user enable username โœ…

Enable a user account. ๐Ÿ”“

๐Ÿ“‹ user list ๐Ÿ“‹

List all users. ๐Ÿ‘ฅ

By default the user's sAMAccountNames are listed. ๐Ÿ“›

  • --full-dn โ€” List user's distinguished names instead of the sAMAccountNames. ๐ŸŒณ
  • -b BASE_DN, --base-dn=BASE_DN โ€” Specify base DN to use. Only users under the specified base DN will be listed. ๐Ÿ“‚
  • --hide-expired โ€” Do not list expired user accounts. โณ
  • --hide-disabled โ€” Do not list disabled user accounts. ๐Ÿšซ
  • --locked-only โ€” Only list locked user accounts. ๐Ÿ”’

๐Ÿ‘‘ user setprimarygroup username primarygroupname ๐Ÿ‘‘

Set the primary group a user account. ๐ŸŽฏ

๐Ÿ‘ฅ user getgroups username ๐Ÿ‘ฅ

Get the direct group memberships of a user account. ๐Ÿ”

๐Ÿ‘€ user show username [options] ๐Ÿ‘€

Display a user AD object. ๐Ÿ“‡

  • --attributes=USER_ATTRS โ€” Comma separated list of attributes, which will be printed. ๐Ÿ“‹

๐Ÿ“ฆ user move username new_parent_dn [options] ๐Ÿ“ฆ

This command moves a user account into the specified organizational unit or container. ๐Ÿšš

The username specified on the command is the sAMAccountName. ๐Ÿ“›

The name of the organizational unit or container can be specified as a full DN or without the domainDN component. ๐Ÿข

๐Ÿ”‘ user password [options] ๐Ÿ”‘

Change password for a user account (the one provided in authentication). ๐Ÿ”

๐Ÿท๏ธ user rename username [options] ๐Ÿท๏ธ

Rename a user and related attributes. ๐Ÿ“

This command allows to set the user's name related attributes. The user's CN will be renamed automatically. The user's new CN will be made up by combining the given-name, initials and surname. A dot (.) will be appended to the initials automatically, if required. Use the --force-new-cn option to specify the new CN manually and --reset-cn to reset this change. ๐Ÿ”„

Use an empty attribute value to remove the specified attribute. ๐Ÿ—‘๏ธ

The username specified on the command is the sAMAccountName. ๐Ÿ“›

  • --surname=SURNAME โ€” New surname ๐Ÿ‘ค
  • --given-name=GIVEN_NAME โ€” New given name ๐Ÿ‘ค
  • --initials=INITIALS โ€” New initials ๐Ÿ”ค
  • --force-new-cn=NEW_CN โ€” Specify a new CN (RDN) instead of using a combination of the given name, initials and surname. ๐Ÿ“›
  • --reset-cn โ€” Set the CN to the default combination of given name, initials and surname. ๐Ÿ”„
  • --display-name=DISPLAY_NAME โ€” New display name ๐Ÿท๏ธ
  • --mail-address=MAIL_ADDRESS โ€” New email address ๐Ÿ“ง
  • --samaccountname=SAMACCOUNTNAME โ€” New account name (sAMAccountName/logon name) ๐Ÿ”‘
  • --upn=UPN โ€” New user principal name ๐ŸŽซ

๐Ÿ•ต๏ธ user sensitive accountname [show|on|off] [options] ๐Ÿ•ต๏ธ

Set/unset or show UF_NOT_DELEGATED for an account. ๐Ÿ”’

  • -H URL, --URL=URL โ€” LDB URL for database or target server ๐Ÿ”—

โณ user setexpiry username [options] โณ

Set the expiration of a user account. ๐Ÿ“…

๐Ÿ”‘ user setpassword username [options] ๐Ÿ”‘

Sets or resets the password of a user account. ๐Ÿ”

๐Ÿ”“ user unlock username [options] ๐Ÿ”“

This command unlocks a user account in the Active Directory domain. ๐ŸŽ‰

๐Ÿ” user getpassword username [options] ๐Ÿ”

Gets the password of a user account. ๐Ÿ”‘

๐ŸŽซ user get-kerberos-ticket username [options] ๐ŸŽซ

Gets a Kerberos Ticket Granting Ticket as the account. ๐ŸŽŸ๏ธ

๐Ÿ”„ user syncpasswords --cache-ldb-initialize [options] ๐Ÿ”„

Syncs the passwords of all user accounts, using an optional script. ๐Ÿ”

Note that this command should run on a single domain controller only (typically the PDC-emulator). โš ๏ธ

๐Ÿ“œ user auth policy assign username [options] ๐Ÿ“œ

Set assigned authentication policy for user. ๐ŸŽฏ

  • --policy โ€” Name of authentication policy to assign or leave empty to remove. ๐Ÿ“

โŒ user auth policy remove username โŒ

Remove assigned authentication policy from user. ๐Ÿ—‘๏ธ

๐Ÿ‘€ user auth policy view username ๐Ÿ‘€

View the assigned authentication policy for user. ๐Ÿ”

๐Ÿ›๏ธ user auth silo assign username [options] ๐Ÿ›๏ธ

Set assigned authentication silo for user. ๐ŸŽฏ

  • --silo โ€” Name of authentication silo to assign or leave empty to remove. ๐Ÿ“

โŒ user auth silo remove username โŒ

Remove assigned authentication silo from user. ๐Ÿ—‘๏ธ

๐Ÿ‘€ user auth silo view username ๐Ÿ‘€

View the assigned authentication silo for user. ๐Ÿ”

๐Ÿ”‘ user keytrust ๐Ÿ”‘

Manage Key Credential Links for a user. ๐Ÿ”—

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. โš ๏ธ

  • --link-target=DN โ€” link to this DN (default: the user's DN) ๐Ÿ”—
  • --encoding=ENCODING โ€” Key format, either pem, der, or auto. The default is auto, which is likely to detect the correct format in all circumstances. ๐Ÿ“„
  • --force โ€” proceed with operations that seems ill-fated โš ๏ธ

โŒ 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. โš ๏ธ

Okay bestie, --dry-run is giving dress rehearsal ๐ŸŽญ โ€” pass it and nothing gets deleted, she just tells you what would have happened if you'd left her out. Main character energy, honestly. ๐Ÿ’…

  • --link-target=DN โ€” yeet this key credential link, identified by a DN
  • --fingerprint=HH:HH:.. โ€” yeet the key credential link that has this key fingerprint
  • --all โ€” yeet every single key credential link, no survivors ๐Ÿ˜ญ
  • -n, --dry-run โ€” do absolutely nothing except print what would happen

user keytrust view username [options]

This is the one you pull up to find a link's fingerprint and target DN for . (yes, the sentence really does just end there, iykyk ๐Ÿ’€). And the --verbose? It includes more, probably useless, information. She's an over-sharer fr.

  • -h, --help โ€” show this help message and exit, classic ๐Ÿซถ
  • -v, --verbose โ€” Be verbose

user generate-csr โ€” time to make a certificate request โœจ

user generate-csr username subject_name private_key_filename output_filename [options]

Generate a PEM-encoded Certificate Signing Request for a user. Slay.

  • --private-key-encoding โ€” specify which encoding the private key uses. Default is 'auto'.
  • --private-key-pass โ€” hand over a password to decrypt the private key. ๐Ÿ”‘

vampire โ€” join and sync a remote AD domain ๐Ÿง›

vampire [options] domain

Join and synchronise a remote AD domain to the local server.

โš ๏ธ BIG WARNING BESTIE: samba-tool vampire is deprecated. Please use samba-tool domain join instead. Like, please. She's retired, let her rest. ๐Ÿ˜ญ

visualize โ€” art class but for your network ๐ŸŽจ

visualize [options] subcommand

Produce graphical representations of Samba network state. To work out what is happening in a replication graph, it is sometimes helpful to use visualisations. Like, sometimes you just gotta look at it, you know?

There are two subcommands, two graphical modes, and (roughly) two modes of operation with respect to the location of authority. Roughly, okay? Don't come for her. ๐Ÿ’…


MODES OF OPERATION ๐Ÿ•ธ๏ธ

  • samba-tool visualize ntdsconn โ€” Looks at NTDS connections.
  • samba-tool visualize reps โ€” Looks at repsTo and repsFrom objects.
  • samba-tool visualize uptodateness โ€” Looks at replication lag as shown by the uptodateness vectors.

GRAPHICAL MODES ๐ŸŒˆ

  • --distance โ€” distances between DCs are shown in a matrix in the terminal.
  • --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. Very demure, very mindful โœจ
  • --xdot โ€” generate Graphviz dot output as with [--dot] and attempt to view it immediately using /usr/bin/xdot.
  • -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. Lowkey the receipts option. ๐Ÿ”

help โ€” when you're lost bestie ๐Ÿซถ

Gives usage information.


VERSION ๐Ÿ‘‘

This man page is complete for version 4.24.7-Ubuntu-4.24.7+dfsg-1ubuntu1 of the Samba suite.


AUTHOR ๐ŸŒธ

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. Iconic behaviour, no cap. ๐Ÿ‘‘


and that's a wrap on SAMBA-TOOL(8) bestie!! ๐Ÿ’– this whole page is complete for Samba 4.24.7-Ubuntu-4.24.7+dfsg-1ubuntu1, it's dated 09/13/2026 (the footer shows it as Samba 4.24.7-Ubuntu-4.24.7+dfs), and it's filed under SAMBA-TOOL(8). go forth and slay your domain controller, ily ๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from