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 therealmparameter in the/etc/samba/smb.conffile. 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 insmb.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 theworkgroupparameter in the/etc/samba/smb.conffile. 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|--useroption 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-ccacheoption. ๐๏ธ
โ ๏ธ Note that specifying this parameter here will override theclient use kerberosparameter in the/etc/samba/smb.conffile.
--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โPATHis the location of a TDB database.mdb://PATHโPATHis the location of an LMDB database.ldb://PATHโPATHis 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 whethersamba-toolshould use ANSI colour codes in its output. Ifauto(the default),samba-toolwill use colour when its output is directed toward a terminal, unless theNO_COLORenvironment 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 thissmb.confconfiguration file. ๐-V,--versionโ Display the version number and exit.-d level,--debuglevel=levelโlevelis an integer from0to10. The default value if this parameter is not specified is1for 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 thelog levelparameter in the/etc/samba/smb.conffile.
--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 withoutdomainDNcounterpart) to defaultCN=Computersin 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, orviif 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, eitherpem,der, orauto. Default isauto, 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 andsamba-toolreturn 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 islonghorn, 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=1to enable aging for this zone.--aging=0to 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 areDisabled,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 intojq.
๐ 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-prepis also used).--domain-prepโ run domain preparation only (unless--forest-prepis 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 secretsis 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, namelymsKds-RootKeyDataandmsKds-SecretAgreementParam. Careful with these, bestie.-v,--verboseโ print more attributes (but not the secret ones, unless--show secretsis 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 secretsis 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 is24.--min-pwd-length=MIN_PWD_LENGTHโ the minimum password length (integer |default). Default is7.--min-pwd-age=MIN_PWD_AGEโ the minimum password age (number of days |default). Default is1.--max-pwd-age=MAX_PWD_AGEโ the maximum password age (number of days |default). Default is43.--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 is30mins.--account-lockout-threshold=ACCOUNT_LOCKOUT_THRESHOLDโ how many bad password attempts are allowed before the account gets locked out (integer |default). Default is0(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 is30.
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 asYYYY-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 istdb).--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.
gpo dellink container_dn gpo [options]
Delete GPO link from a container.
gpo fetch gpo [options]
Download a GPO.
gpo getinheritance container_dn [options]
Get inheritance flag for a container.
gpo getlink container_dn [options]
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 togPCMachineExtensionNames--user-ext-name=USER_EXTSโ a user extension name to add togPCUserExtensionNames--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.1is Enabled,0is 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.
gpo setlink container_dn gpo [options]
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 fromgPCMachineExtensionNames--user-ext-name=USER_EXTSโ a user extension name to remove fromgPCUserExtensionNames--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 oldGPT.INIfile 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 sysvolgpo manage symlink addโ Adds a VGP Symbolic Link Group Policy to the sysvolgpo manage symlink removeโ Removes a VGP Symbolic Link Group Policy from the sysvolgpo manage files listโ List VGP Files Group Policy from the sysvolgpo manage files addโ Add VGP Files Group Policy to the sysvolgpo manage files removeโ Remove VGP Files Group Policy from the sysvolgpo manage openssh listโ List VGP OpenSSH Group Policy from the sysvolgpo manage openssh setโ Sets a VGP OpenSSH Group Policy to the sysvolgpo 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 sysvolgpo manage scripts startup addโ Adds VGP Startup Script Group Policy to the sysvolgpo manage scripts startup removeโ Removes VGP Startup Script Group Policy from the sysvolgpo manage motd listโ List VGP MOTD Group Policy from the sysvol.gpo manage motd setโ Sets a VGP MOTD Group Policy to the sysvolgpo manage issue listโ List VGP Issue Group Policy from the sysvol.gpo manage issue setโ Sets a VGP Issue Group Policy to the sysvolgpo manage access addโ Adds a VGP Host Access Group Policy to the sysvolgpo manage access listโ List VGP Host Access Group Policy from the sysvolgpo 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, orviif 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 thesmb.confservice to use. This option is required in combination with the--use-s3fsoption.--use-s3fsโ set the ACLs for use with the default s3fs file server via the VFS layer. This option requires asmb.confservice, specified by the--service=SERVICEoption.--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--recursiveis 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, orviif 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, eitherpem,der, orauto. The default isauto, 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 โ peek at a user's key credential links ๐
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 vampireis deprecated. Please usesamba-tool domain joininstead. 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 usingdotorxdot, 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-tooltalks to one database; with the[-r]option attempts are made to contact all the DCs known to the first database. This is necessary forsamba-tool visualize uptodatenessand forsamba-tool visualize repsbecause 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
- ubuntu stonking: python3-samba 2:4.24.7+dfsg-1ubuntu1 ยท GPL-3.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms