Understanding Active Directory: The Technology Behind Enterprise AI Security - Part 3: Joining Clients and Servers to the Domain

Understanding Active Directory: The Technology Behind Enterprise AI Security - Part 3: Joining Clients and Servers to the Domain

Hello! In Part 2, we explored AD naming, domain controllers, and DNS. This time, we look at joining PCs and servers to that domain.

Creating a user account and joining a device to a domain are separate tasks. We will connect the prerequisites, the join procedure, and the checks that follow.

This article covers joining on-premises AD DS. The comics are fictional teaching conversations, not accounts of actual incidents or test results.

Series Outline

3.1 Domain join fundamentals

3.1.1 Windows sign-in and service authentication

Windows sign-in and service access. Dialogue follows the image.
Windows sign-in and service access
  • Developer“Can my account sign in to any PC?”
  • Trainer“Windows domain sign-in also needs a joined PC.”
  • Trainer“Service authentication may work under different conditions.”
  • Developer“I will separate PC sign-in from service access.”

Signing in to Windows with an AD domain account requires the PC to be joined as well.

Joining AD DS registers the device through a computer account and configures credentials for communication with the domain. Connecting a network cable does not perform that registration.

OperationWhat to check
Domain sign-in to WindowsPC membership, the user account, and policies that permit sign-in
Authentication to a file share or web serviceSupported authentication methods, credentials, and restrictions on connecting devices
Sign-in while a DC is unavailableWhether earlier sign-in information is cached and the device policy permits its use

Depending on the service configuration, a PC that is not joined may still authenticate with explicitly supplied domain credentials. It is incorrect to say that all authentication from an unjoined device is rejected.

Conversely, joining a PC does not allow every user to sign in unconditionally. Account status and logon rights remain separate controls.

Cached logon allows a user to enter that PC when a DC is unavailable. It does not guarantee access to an online server or the ability to obtain a new Kerberos ticket.

Sources

3.1.2 People and devices have separate accounts

A computer account identifies the device itself.

A user account represents a person; a computer account represents a PC or member server. For a device named PC-101, its computer sAMAccountName is normally PC-101$.

Distinguish this attribute from the name displayed by a management tool. The list in Active Directory Users and Computers does not necessarily display a trailing $.

Account informationPurpose
SIDIdentifies the security principal independently of its name
sAMAccountNameThe legacy account name, normally ending in $ for a computer
DNS name and SPNsAssociate device and service names with authentication
Machine account secretAuthenticates the device to the domain; managed separately from a person’s password

A computer account is not unconditional proof that a device is safe. Updates, endpoint protection, and access controls still need to be operated after joining.

Sources

3.1.3 Separate local administration from AD permissions

Two sides of join permissions. Dialogue follows the image.
Two sides of join permissions
  • Developer“Do I need Domain Admins to join a PC?”
  • Trainer“Separate local admin rights from AD join permissions.”
  • Trainer“Delegate the required rights on the target OU.”
  • Developer“I will limit access to the task.”

Permission to change the PC and permission to create or reuse an AD account are separate.

For a normal online join, administer the PC locally and use credentials with the required AD join permissions. There is no need to give every operator membership in Domain Admins or Account Operators.

AD account statePermissions to plan
Create a new computer accountPermission to create computer objects in the target OU or container
Reuse an existing accountReset Password, validated writes to DNS host name and SPNs, and other required rights; also check the trusted owner conditions
Rename during the joinCheck the required creation or modification rights according to whether the account is new or reused

An ordinary domain user may be allowed to join devices under the domain’s configuration. Rather than assuming that ordinary users can never join a PC, check delegation on the target OU, existing join rights, and account quotas.

Windows domain join hardening also checks ownership when reusing an existing account. Meet both the permission requirements and trust conditions. Do not disable protection or immediately delete the account just because a join fails.

Sources

3.2 Joining a domain

3.2.1 Joining a Windows PC

Check, join, then restart. Dialogue follows the image.
Check, join, then restart
  • Developer“Can I join as soon as I connect the PC?”
  • Trainer“Check DNS, connectivity, time and permissions first.”
  • Trainer“After joining, restart and verify membership and sign-in.”
  • Developer“I will check that the joined PC actually works.”

Check the Windows edition, DNS, connectivity, time, and permissions before joining.

Use an edition that supports AD DS join, such as Windows 11 Pro or Enterprise. Home is not supported. Configure DNS that can resolve the AD namespace and allow the required communication to a DC.

  1. 1Choose the computer name, domain DNS name, and destination OU. Check that the name does not conflict with an existing device.
  2. 2With local administrative rights, open the Computer Name tab in System Properties, select Change, and choose Domain.
  3. 3Enter the domain name and authenticate using credentials with the necessary AD permissions.
  4. 4Confirm the join result and restart. Sign in as a domain user, then verify membership and the services the user needs.

The GUI join dialog does not directly select an OU. To place the account in a particular OU, prestage it there or move it afterwards with appropriate permissions. PowerShell can specify OUPath as shown below. A prestaged account is subject to the reuse permissions and owner checks.

In Settings, the connection dialog under Access work or school also offers joining a local Active Directory domain. Distinguish that option from Microsoft Entra join or merely adding a work account.

The following example is for an elevated Windows PowerShell 5.1 session. The domain, computer name, and OU are illustrative. The OU must already exist and the join account must have the required delegated permissions.

$joinParams = @{
    DomainName = 'corp.example.com'
    NewName = 'PC-101'
    OUPath = 'OU=Workstations,DC=corp,DC=example,DC=com'
    Credential = Get-Credential
    PassThru = $true
    Verbose = $true
}
Add-Computer @joinParams

This example does not restart automatically. Confirm that the operation succeeded and save open work before restarting. Enter credentials interactively instead of embedding a password in a script.

Domain join workflow, based on Microsoft’s join instructions.Check prerequisitesNames, connectivity,time, and permissionsJoin the domainConfigure the computeraccount and credentialsCheck after restartingMembership, sign-in,and required services
Domain join workflow, based on Microsoft’s join instructions. Diagram by Qualiteg.
Sources

3.2.2 Joining a member server is not DC promotion

Joining Windows Server to a domain does not make it a domain controller.

A member server can provide files, web applications, or databases as part of the domain. Becoming a DC requires installing the AD DS role and performing domain controller promotion as separate work.

  1. 1Open Local Server in Server Manager and select the workgroup or domain name link.
  2. 2In the Computer Name settings, select Change and specify the destination domain.
  3. 3Enter credentials, confirm the result, and restart.

Decide when to join based on service account and application installation requirements. There is no universal rule that every application must be installed only after a server joins.

Manage the server’s address and name consistently. Check DNS registration, startup dependencies, and restart impact. A successful domain join and successful application authentication require separate verification.

Sources

3.2.3 Choose the Linux purpose and ID mapping first

Choose Linux integration by purpose. Dialogue follows the image.
Choose Linux integration by purpose
  • Developer“Can Linux use AD user accounts too?”
  • Trainer“Separate login integration from serving SMB shares.”
  • Trainer“Use Winbind for a Samba member server.”
  • Developer“I will choose the method and access for the job.”

Plan Linux login integration separately from providing SMB shares through Samba.

Login integration can use methods such as SSSD. A Samba member server uses Winbind to map AD SIDs to Linux UIDs and GIDs.

The following Ubuntu Winbind example assumes a single domain. First check AD DNS, time, and the host name, then install the required packages.

sudo apt update
sudo apt install samba winbind libnss-winbind libpam-winbind krb5-user

Specify the domain and ID mapping method in the [global] section of /etc/samba/smb.conf. These example ranges must be checked against local IDs and other domains for overlap and sufficient capacity before use.

[global]
    security = ads
    realm = CORP.EXAMPLE.COM
    workgroup = CORP
    idmap config * : backend = tdb
    idmap config * : range = 100000-199999
    idmap config CORP : backend = rid
    idmap config CORP : range = 1000000-1999999
    winbind use default domain = no
    winbind enum users = no
    winbind enum groups = no
    winbind refresh tickets = yes
    kerberos method = secrets and keytab

After saving, check syntax, join the domain, test the trust, and look up a user. Replace join_domain with an appropriately authorized join account and user with an existing test user.

testparm -s
sudo net ads join -U 'CORP\join_domain'
sudo systemctl restart winbind
sudo net ads testjoin
sudo wbinfo -t
id 'CORP\user'

SMB service also requires share definitions and filesystem permissions. Finding a user with id does not prove that the user can access a share or sign in through SSH.

If OS login is required, check NSS/PAM, the login shell, home directories, and allowed users or groups. NSS setup differs between Ubuntu 24.04 LTS and older releases, so inspect the existing passwd and group entries instead of replacing them wholesale.

Changing ID mapping methods or ranges later can affect the ownership of existing files. Plan a consistent mapping before deploying across multiple domains or Linux machines.

Sources

3.2.4 Narrow failures down with DNS, connectivity, and permissions

Read the join log alongside the error message before deciding on a cause.

The Windows join log is %windir%\debug\NetSetup.log. Record the failure time, error code, and DC, then check DNS, connectivity, credentials, and existing account reuse.

ipconfig /all
nslookup -type=SRV _ldap._tcp.dc._msdcs.corp.example.com
nltest /dsgetdc:corp.example.com
Test-NetConnection -ComputerName dc01.corp.example.com -Port 445
w32tm /query /status
w32tm /stripchart /computer:dc01.corp.example.com /samples:5 /dataonly
FindingNext check
SRV records do not resolveClient DNS, zones, and SRV registration. Do not mix in public DNS as an alternate resolver
DC name resolves but connections failRouting and firewalls, including required DNS, LDAP, Kerberos, SMB, and RPC traffic
Credential or permission failureAccount state, name format, OU delegation, and account owner conditions for reuse
Significant time differenceTime sources and policy. Correct the configuration according to the domain time hierarchy

A successful TCP 445 test does not prove that all required join traffic works. Check Microsoft’s requirements and the relevant OS configuration, including UDP and dynamic RPC ports. Lack of a ping reply alone also does not determine whether AD communication is available.

When an account with the same name already exists, determine whether it belongs to an active device or is intended for reuse. If a security check blocks reuse, inspect ownership and delegation before deleting anything.

Sources

3.3 Trust and policy after joining

3.3.1 Testing the secure channel

Test the secure channel before repair. Dialogue follows the image.
Test the secure channel before repair
  • Developer“Should I rejoin for every trust error?”
  • Trainer“First check DNS, connectivity and both sides of the account.”
  • Trainer“On a member PC, test the secure channel.”
  • Developer“I will identify the cause before choosing a repair.”

Matching machine account information on the device and in AD is the foundation of the trust.

The Netlogon secure channel supports authenticated communication between a domain member and a DC. It does not mean that all traffic from the device travels through an encrypted VPN.

On a member PC or member server, run the following in an elevated Windows PowerShell session. Do not use it to test a DC itself, because this cmdlet can report false errors on a domain controller.

Test-ComputerSecureChannel -Verbose

True means that the tested secure channel is functioning. For False, first check DNS, connectivity, and the account state, then investigate mismatched secrets caused by restoration or another device using the same name.

If connectivity is healthy and you have determined that repair is appropriate, a member device can attempt repair using suitably authorized credentials. Test again afterwards, then verify user sign-in and service access.

Test-ComputerSecureChannel -Repair -Credential (Get-Credential)
Test-ComputerSecureChannel -Verbose

Rejoining is one possible remedy after assessing the cause and impact. Starting every recovery by moving the PC into a workgroup can overlook the local account needed for recovery and the effect on applications.

Sources

3.3.2 The device updates its machine account password

People do not normally need to re-enter a machine account password periodically.

By default, Windows domain members request a password change every 30 days. This is a device-side change interval, not the same concept as a person’s password expiration.

When investigating broken trust, consider whether a restore left one side with older information, or whether AD replication has a problem. Being powered off for a long time does not, by itself, establish a password mismatch as the cause.

Avoid disabling automatic changes in normal operation. VM cloning and restore procedures should also prevent multiple running devices from sharing the same computer account.

The following read-only command inspects Netlogon registry settings. A value may not be explicitly present, so interpret the result alongside effective policy and documented defaults.

reg query HKLM\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters
Sources

3.3.3 Check GPO scope and applied results

Verify the applied policy. Dialogue follows the image.
Verify the applied policy
  • Developer“Does a new GPO reach every PC at once?”
  • Trainer“Links and filters determine which objects receive it.”
  • Trainer“Refresh timing and signing in again can also matter.”
  • Developer“I will check the scope and the applied results.”

Creating a GPO does not automatically deliver it to every PC.

Links to sites, domains, and OUs, together with security and WMI filters, determine scope. The basic processing order is local, site, domain, then parent to child OU; enforcement and inheritance blocking also affect the outcome.

Group Policy application and verification, based on Microsoft’s processing documentation.Determine scopeLinks, security filters,and other conditionsCheck when it runsStartup, sign-in,and background refreshInspect the resultgpresult and theGroupPolicy event log
Group Policy application and verification, based on Microsoft’s processing documentation. Diagram by Qualiteg.
TimingWhat to check
Startup and sign-inSome settings require processing at these times
Background refresh on ordinary membersBy default, 90 minutes plus a random delay of 0 to 30 minutes
DC computer policyThe default check interval is 5 minutes
Manual refreshRunning gpupdate does not make every setting take effect immediately

Requesting an update and checking its result are separate operations. The example below requests a refresh, shows a policy summary, and writes an HTML report to the current user’s temporary directory.

gpupdate /force
gpresult /r
$reportPath = Join-Path $env:TEMP ("gpreport-{0}.html" -f (Get-Date -Format "yyyyMMdd-HHmmss"))
gpresult /h $reportPath

Use the required administrative rights when inspecting computer policy. Check which user the report describes; a session running as a different administrator may not represent the affected user.

If a setting is missing, check the OU, links, filters, DC replication, and whether signing out or restarting is required. Also inspect Microsoft-Windows-GroupPolicy/Operational in Event Viewer.

Sources

Summary

For domain join, distinguish people from device accounts, and local administrative rights from AD permissions. After joining, verify sign-in, the secure channel, required services, and applied Group Policy.

On Linux, choose the purpose and ID mapping first. When something fails, narrow down the cause using real logs, DNS results, and connectivity checks from your environment rather than relying on an invented success transcript.

Next time

Part 4 covers proxy servers and Integrated Windows Authentication. We will see how domain membership connects to browser and application authentication.

See you in the next article!

Qualiteg Technology Consulting

Company-wide AI security — from foundations to day-to-day operations.

From foundations such as identity and access management to LLM-specific risks (prompt injection, data leakage, harmful output) — using AI safely across an organization involves a wide range of concerns.

We develop and operate our own LLM auditing product, "LLM-Audit." Drawing on that expertise, we provide practical support spanning audits and assessments, defensive measures, and secure operational design.

Explore our LLM security services →

Read more