ADCLI(8) | System Commands | ADCLI(8) |
adcli - Tool for performing actions on an Active Directory domain
adcli info domain.example.com
adcli join domain.example.com
adcli update
adcli testjoin
adcli create-user [--domain=domain.example.com] user
adcli delete-user [--domain=domain.example.com] user
adcli create-group [--domain=domain.example.com] user
adcli delete-group [--domain=domain.example.com] user
adcli add-member [--domain=domain.example.com] group user...
adcli remove-member [--domain=domain.example.com] group user...
adcli preset-computer [--domain=domain.example.com] computer...
adcli reset-computer [--domain=domain.example.com] computer
adcli delete-computer [--domain=domain.example.com] computer
adcli is a command line tool that can perform actions in an Active Directory domain. Among other things it can be used to join a computer to a domain.
See the various sub commands below. The following global options can be used:
-D, --domain=domain
-R, --domain-realm=REALM
-S, --domain-controller=server
-C, --login-ccache=ccache_name
-U, --login-user=User
--no-password
-W, --prompt-password
--stdin-password
-v, --verbose
adcli info displays discovered information about an Active Directory domain or an Active Directory domain controller.
$ adcli info domain.example.com ...
$ adcli info --domain-controller=dc.domain.example.com ...
adcli info will output as much information as it can about the domain. The information is designed to be both machine and human readable. The command will exit with a non-zero exit code if the domain does not exist or cannot be reached.
To show domain info for a specific domain controller use the --domain-controller option to specify which domain controller to query.
Use the --verbose option to show details of how the domain is discovered and queried. Many of the global options, in particular authentication options, are not usable with the adcli info command.
adcli join creates a computer account in the domain for the local machine, and sets up a keytab for the machine. It does not configure an authentication service (such as sssd).
$ adcli join domain.example.com Password for Administrator:
In addition to the global options, you can specify the following options to control how this operation is done.
-N, --computer-name=computer
-O, --domain-ou=OU=xxx
-H, --host-fqdn=host
-K, --host-keytab=/path/to/keytab
--login-type={computer|user}
--os-name=name
--os-service-pack=pack
--os-version=version
--service-name=service
--user-principal=host/name@REALM
--one-time-password
--trusted-for-delegation=yes|no|true|false
--add-service-principal=service/hostname
--show-details
--show-password
--add-samba-data
Please note that Samba's net requires some settings in smb.conf to create the database entries correctly. Most important here is currently the workgroup option, see smb.conf(5) for details.
Note that if the machine account password is not older than 30 days, you have to pass --computer-password-lifetime=0 to force the update.
--samba-data-tool=/path/to/net
If supported on the AD side the msDS-supportedEncryptionTypes attribute will be set as well. Either the current value or the default list of AD's supported encryption types filtered by the permitted encryption types of the client's Kerberos configuration are written.
adcli update updates the password of the computer account on the domain controller for the local machine, write the new keys to the keytab and removes older keys. It keeps the previous key on purpose because AD will need some time to replicate the new key to all DCs hence the previous key might still be used.
$ adcli update
If used with a credential cache, other attributes of the computer account can be changed as well if the principal has sufficient privileges.
$ kinit Administrator $ adcli update --login-ccache=/tmp/krbcc_123
In addition to the global options, you can specify the following options to control how this operation is done.
-N, --computer-name=computer
-H, --host-fqdn=host
-K, --host-keytab=/path/to/keytab
--os-name=name
--os-service-pack=pack
--os-version=version
--service-name=service
--user-principal=host/name@REALM
--computer-password-lifetime=lifetime
--trusted-for-delegation=yes|no|true|false
--add-service-principal=service/hostname
--remove-service-principal=service/hostname
--show-details
--add-samba-data
Please note that Samba's net requires some settings in smb.conf to create the database entries correctly. Most important here is currently the workgroup option, see smb.conf(5) for details.
--samba-data-tool=/path/to/net
If supported on the AD side the msDS-supportedEncryptionTypes attribute will be set as well. Either the current value or the default list of AD's supported encryption types filtered by the permitted encryption types of the client's Kerberos configuration are written.
adcli testjoin uses the current credentials in the keytab and tries to authenticate with the machine account to the AD domain. If this works the machine account password and the join are still valid. If it fails the machine account password or the whole machine account have to be refreshed with adcli join or adcli update.
$ adcli testjoin
Only the global options not related to authentication are available, additionally you can specify the following options to control how this operation is done.
-K, --host-keytab=/path/to/keytab
adcli create-user creates a new user account in the domain.
$ adcli create-user Fry --domain=domain.example.com \ --display-name="Philip J. Fry" --mail=fry@domain.example.com
In addition to the global options, you can specify the following options to control how the user is created.
--display-name="Name"
-O, --domain-ou=OU=xxx
--mail=email@domain.com
--unix-home=/home/user
--unix-gid=111
--unix-shell=/bin/shell
--unix-uid=111
--nis-domain=nis_domain
adcli delete-user deletes a user account from the domain.
$ adcli delete-user Fry --domain=domain.example.com
The various global options can be used.
adcli create-group creates a new group in the domain.
$ adcli create-group Pilots --domain=domain.example.com \ --description="Group for all pilots"
In addition to the global options, you can specify the following options to control how the group is created.
--description="text"
-O, --domain-ou=OU=xxx
adcli delete-group deletes a group from the domain.
$ adcli delete-group Pilots --domain=domain.example.com
The various global options can be used.
adcli add-member adds one or more users to a group in the domain. The group is specified first, and then the various users to be added.
$ adcli add-member --domain=domain.example.com Pilots Leela Scruffy
The various global options can be used.
adcli remove-member removes a user from a group in the domain. The group is specified first, and then the various users to be removed.
$ adcli remove-member --domain=domain.example.com Pilots Scruffy
The various global options can be used.
adcli preset-computer pre-creates one or more computer accounts in the domain for machines to later use when joining the domain. By doing this machines can join using a one time password or automatically without a password.
$ adcli preset-computer --domain=domain.example.com \ host1.example.com host2 Password for Administrator:
If the computer names specified contain dots, then they are treated as fully qualified host names, otherwise they are treated as short computer names. The computer accounts must not already exist.
In addition to the global options, you can specify the following options to control how this operation is done.
-O, --domain-ou=OU=xxx
--one-time-password
--os-name=name
--os-service-pack=pack
--os-version=version
--service-name=service
--user-principal
adcli reset-computer resets a computer account in the domain. If the appropriate machine is currently joined to the domain, then its membership will be broken. The account must already exist.
$ adcli reset-computer --domain=domain.example.com host2
If the computer names specified contain dots, then they are treated as fully qualified host names, otherwise they are treated as short computer names.
In addition to the global options, you can specify the following options to control how this operation is done.
--login-type={computer|user}
adcli delete-computer deletes a computer account in the domain. The account must already exist.
$ adcli delete-computer --domain=domain.example.com host2 Password for Administrator:
If the computer name contains a dot, then it is treated as fully qualified host name, otherwise it is treated as short computer name.
If no computer name is specified, then the host name of the computer adcli is running on is used, as returned by gethostname().
The various global options can be used.
Please send bug reports to either the distribution bug tracker or the upstream bug tracker at https://bugs.freedesktop.org/enter_bug.cgi?product=realmd&component=adcli
Further details available in the realmd online documentation at http://www.freedesktop.org/software/realmd/
realmd |