Přidat PC s Debian 20.04 do AD

Od posmura

 

#!/bin/bash

###########################################################################
# Add PC into Active Directory #
###########################################################################

# Set AD user with admin privileges
# ———————————-
ADM=USERNAME
ADD=DOMAIN.XY

# kinit – obtain and cache Kerberos ticket-granting ticket
# ———————————————————
sudo kinit -V “${ADM}@${ADD^^}”

# net – tool for administration of Samba and remote CIFS servers
# ————————————————————–
# Join a domain. If the account already exists on the server, and [TYPE]
# is MEMBER, the machine will attempt to join automatically. (Assuming
# that the machine has been created in server manager) Otherwise, a
# password will be prompted for, and a new account may be created.
sudo net ads join –no-dns-updates -U “${ADM}”

# klist – list cached Kerberos tickets
# ————————————
sudo klist

# Print information about the domain
# ———————————-
sudo net ads info