LinuxCommandLibrary

add-computer.py

TLDR

Add a computer with a specific name and password

$ addcomputer.py -computer-name [COMPUTER_NAME$] -computer-pass [computer_password] [domain]/[username]:[password]
copy

Only set a new password on an existing computer
$ addcomputer.py -no-add -computer-name [COMPUTER_NAME$] -computer-pass [computer_password] [domain]/[username]:[password]
copy

Delete an existing computer account
$ addcomputer.py -delete -computer-name [COMPUTER_NAME$] [domain]/[username]:[password]
copy

Add computer using Kerberos authentication
$ addcomputer.py -k -no-pass [domain]/[username]@[hostname]
copy

Add computer via LDAPS (port 636) instead of SAMR (port 445)
$ addcomputer.py -method LDAPS -port 636 [domain]/[username]:[password]
copy

Specify exact domain controller when multiple DCs exist
$ addcomputer.py -dc-host [hostname] [domain]/[username]:[password]
copy

SYNOPSIS

python3 add-computer.py [-d DOMAIN] [-u USER] [-p PASS] [-c COMPUTERNAME] [other options]

PARAMETERS

-d, --domain
    Specifies the target domain or realm to join

-u, --user
    Admin username for authentication

-p, --password
    Password (use --password-stdin for security)

-c, --computername
    Name of the computer account to add

-o, --ou
    Organizational Unit path for the computer object

--server
    Domain controller or server FQDN

-h, --help
    Display usage information

-v, --verbose
    Enable verbose logging

DESCRIPTION

add-computer.py is not a standard Linux command found in common distributions or man pages. It appears to be a custom or third-party Python script, likely used in environments like Active Directory integration, Jamf Pro management, or enterprise inventory systems to add computer accounts or enroll devices.

Typically invoked with python add-computer.py or directly if executable, it automates tasks such as joining a computer to a domain, registering it in a directory service, or uploading details to a management server. Common use cases include sysadmin workflows for onboarding new machines in hybrid Windows-Linux setups using Samba/SSSD or MDM tools.

Without access to the specific script source (e.g., from GitHub repos for Jamf API or AD tools), exact behavior varies. It may require parameters like domain name, credentials, and computer name. Always review the script code for security, as custom scripts can pose risks if run with elevated privileges. Alternatives like realm join or net ads join provide native functionality for domain joins on Linux.

CAVEATS

Not a standard command; source-specific. May require root privileges and dependencies like python-ldap, samba. Insecure if passwords passed plainly. Test in non-prod environments.

EXAMPLE USAGE

python3 add-computer.py -d example.com -u admin -p secret -c linuxhost
echo 'secret' | python3 add-computer.py -d example.com -u admin --password-stdin -c linuxhost

DEPENDENCIES

Often requires python3-ldap, samba-client, krb5-user. Install via apt/yum.

HISTORY

Emerges from custom tools circa 2010s for AD/Jamf integration on Unix-like systems. Evolved with Python's popularity in automation; no official upstream development.

SEE ALSO

realm(8), net(8), ipa-client-install(1), adcli(1), sssd(8)

Copied to clipboard