Active Directory Architecture and Management Questions
Designing, operating and recovering Active Directory Domain Services and the directory estate around it. Covers logical and physical structure (forests, trees, domains, OUs, trusts, schema extension, FSMO roles, Global Catalog, RODCs), sites and replication topology, domain controller placement, promotion, upgrade and functional levels, DC locator and AD-integrated DNS, domain join, Kerberos and NTLM authentication including SPNs and delegation, token size and SID history, LDAP binds and query tuning, Group Policy design, processing order, filtering, deployment and troubleshooting, user, group, computer and service account management including PowerShell account scripting and account lockout investigation, delegation of control and tiered administration, fine-grained password policy, backup, authoritative restore, forest recovery and USN rollback, AD hardening against Kerberoasting, DCSync and Golden Ticket attacks, forest migration, and hybrid identity with Microsoft Entra ID (Microsoft Entra Connect, Cloud Sync, password hash sync, pass-through authentication, federation, password writeback). Questions are asked from the directory administrator's and architect's seat. Platform-neutral identity protocols and lifecycle design, Windows file-server administration (shares, NTFS permissions, profiles), Linux directory integration, and generic DNS and DHCP service operations are covered elsewhere.
Design a self-service password reset service for a hybrid directory. How do you verify users, write the new password back to on-premises AD, and stop social-engineering abuse?
Sample Answer
Direct answer
Build it on Microsoft Entra self-service password reset (SSPR: the user proves who they are in the cloud and picks a new password without calling the help desk) with password writeback, which carries the new password back to on-premises Active Directory (AD, the Windows directory that holds the user accounts). Verify users with two registered authentication methods, write the password back through an outbound-only encrypted channel to an agent that calls AD's own set-password API (so AD's password rules still apply), and stop social engineering by protecting the registration step, keeping privileged accounts out of the self-service path, and notifying people about every reset.
The picture
In a hybrid directory each person has two linked accounts: a cloud account in Microsoft Entra ID (Microsoft's cloud directory) and an on-premises account in AD, matched by the sync service. SSPR changes the password on the cloud account. Writeback is the step that makes the same change on the on-premises account, so the person ends up with one password that works in both places.
Design
| Stage | Decision |
|---|---|
| Who is in scope | Users whose password is managed on-premises under password hash synchronization, pass-through authentication or AD FS (Active Directory Federation Services). SSPR writeback is not supported while staged rollout (a feature that moves chosen groups of users to cloud authentication gradually) is enabled for a security group. |
| Licence | At least Microsoft Entra ID P1. |
| Writeback engine | Microsoft Entra Connect Sync (wizard page Optional features, box Password writeback) or Microsoft Entra Connect cloud sync. Cloud sync does not depend on one Connect server, so it gives higher availability. If both are configured for the same domain, the cloud sync agent processes the writebacks. |
| Switch in the cloud | Entra admin center, Password reset, On-premises integration: Write back passwords to your on-premises directory, and optionally Allow users to unlock accounts without resetting their password. |
How users are verified
- Set the number of methods required to reset to two (the setting accepts one or two).
- The methods SSPR supports are Microsoft Authenticator notifications, hardware or software OATH tokens (devices or apps that generate one-time codes), SMS, voice call and email one-time passcode. Authenticator cannot be the only method when one is required, and when two are required enable at least two further methods beside it.
- Turn on Require users to register when signing in so nobody stays unregistered, and set the reconfirmation interval (0 to 730 days, where 0 means never) to something like 180 days so stale phone numbers are caught.
- Do not build a path that depends on facts an attacker can look up (birthplace, school). Administrator accounts are even stricter: a two-gate policy that prohibits security questions applies to them automatically.
How the password reaches AD
-
The user submits the new password. It is encrypted with a public key created at setup and sent over HTTPS to a tenant-specific Azure Service Bus relay (a cloud message relay protected by a randomly generated password that only your on-premises installation knows).
-
The on-premises agent already holds an outbound connection, so no inbound firewall rule is needed; all traffic is outbound on port 443. It decrypts the message and finds the user through the cloudAnchor attribute (the attribute the sync engine uses to link a cloud user back to its on-premises object).
-
It calls the AD DS SetPassword API, so the on-premises history, complexity, age and password-filter rules (extra rules that password-filter software adds on the DCs) are enforced and the user gets an immediate answer. If the writeback service is down the user is told the reset cannot be done right now, and an undelivered message expires after several minutes.
-
The AD account used by Entra Connect needs: Reset password, Change password, write on lockoutTime, write on pwdLastSet (all applied to descendant user objects) and the extended right Unexpire Password on the root of each domain. Set the domain policy Minimum password age to 0 if users may reset more than once a day. Permission changes can take an hour or more to replicate.
Why each right is there. Microsoft's tutorial lists these rights without a reason per line; in plain terms: Reset password lets the account set a new password without knowing the old one, which is what an SSPR reset is. Change password covers a change where the user supplies the old password. Write on lockoutTime (the attribute AD uses to hold an account's locked-out state) is what lets the option Allow users to unlock accounts without resetting their password clear a lockout. Write on pwdLastSet (the attribute that records when the password was last set) and the Unexpire Password right let a reset mark the password as freshly set, so an account whose old password had expired is not still treated as expired. Minimum password age of 0 matters because a nonzero age would refuse a second reset inside that window.
Four controls against social engineering
| Control | What it stops |
|---|---|
| Protect registration: a Conditional Access policy (rules that decide whether a sign-in or action is allowed) on the user action Register security information that demands an authentication strength (a Conditional Access setting that names which combinations of sign-in methods are acceptable) or a trusted location, plus a Temporary Access Pass (TAP, a time-limited passcode, default lifetime 1 hour, can be single-use) issued only after the help desk has proven who the person is, for example by calling the manager on a number from the HR system | An attacker registering their own phone against a new hire's account before the real person does. Roll out in report-only mode first (the policy is evaluated and logged but not enforced) and exclude break-glass accounts (emergency administrator accounts kept outside the policy so a mistake cannot lock every admin out). |
| Strong methods only, two required | Guessing or researching a single weak factor. |
| Notifications: Notify users on password resets, and Notify all admins when other admins reset their passwords | A silent takeover; the real owner gets an email. |
| Privileged accounts stay out of writeback | The writeback account cannot change passwords for members of protected groups, so a convincing caller cannot reset a domain admin's on-premises password through self-service. Those resets use a two-person help-desk procedure. |
How the protected-group limit works. Microsoft's note says the writeback service account cannot change passwords for members of protected groups (for example Domain Admins, Enterprise Admins, Schema Admins, Administrators and Account Operators; the full list is in Microsoft's protected-accounts appendix). The mechanism is AdminSDHolder, an object that holds the template permissions for protected accounts and groups. A process called SDProp runs every 60 minutes by default on the PDC emulator and resets the permissions on every protected account to match that template, and inheritance is switched off on protected accounts. So the rights you granted the writeback account at the top of the domain never reach those accounts. Administrators can still change their password in the cloud, but cannot use writeback to reset a forgotten on-premises one.
Worked example
Priya forgets her password. She opens the SSPR page, answers a captcha, approves an Authenticator notification and enters a code from her OATH token (two methods). She types a new password. AD checks it against its policy; if it fails the policy she is told at once. If it passes, her cloud and on-premises passwords are the same within seconds. Mallory phones the help desk knowing Priya's birthday and employee number. Neither is an accepted factor, the desk cannot issue a TAP without the manager callback, and a successful reset would also email Priya.
Trade-offs and pitfalls
- Resetting from the Microsoft 365 admin center or with PowerShell version 1 or 2 is not written back; use the Entra admin center or the Graph API so admin resets stay consistent.
- If inheritance is disabled on user objects the write permissions never reach them and writeback fails for those users.
- On-premises policy wins even when the cloud policy is weaker, so a user can see a rejection the cloud would have accepted.
- After a reset, NTLM (an older challenge-response sign-in protocol) network logons can keep working with the old password for five minutes (default, when the domain remembers two or more passwords); do not read that as a failed reset.
A web application running as a service account must query a SQL backend as the end user. How do you make that work without granting more trust than necessary, and what changes if the two services sit in different domains?
Sample Answer
Direct answer
Make the web application a delegating service using constrained delegation (Kerberos lets the service obtain tickets to one named back-end service for the signed-in user), preferably the resource-based form, and never unconstrained delegation. First ask whether the SQL queries need the end user's identity at all. If they do, the web application's account, its Service Principal Names (SPNs, the names Kerberos uses to find a service's account) and the SQL account's delegation settings must all be right. If the two services are in different domains, classic constrained delegation cannot work and resource-based delegation can.
Why a plain service account is not enough
The user signs in to the web application (hop 1), and the web application then calls SQL (hop 2). The web application receives proof of the user's identity for itself only. NTLM cannot carry the identity across the second hop, so Kerberos delegation is required. That is the double-hop problem.
A user-by-user trace. Alice signs in to the web application with Kerberos (hop 1), so the application holds a ticket proving Alice to the application, and nothing usable at SQL. For hop 2 the application, running as CORP\webapp$, asks the domain controller's Kerberos service for a ticket to MSSQLSvc/sqlhost in Alice's name. The domain controller checks one list: in classic delegation, whether the SQL SPN is in the front end's allowed-to-delegate-to list; in resource-based delegation, whether the front end is named on the SQL account. If yes, SQL sees CORP\alice. If no, the request is refused and SQL sees either a failed Kerberos login or an NTLM fallback with the application's own identity.
The three delegation types
| Type | Who configures it | What it allows | Risk |
|---|---|---|---|
| Unconstrained | Set on the front-end account | The service can impersonate the user to any service | Any compromise of the front end exposes every service the user can reach |
| Constrained (classic) | Domain admin, on the front-end account | Impersonation only to the listed back-end services, within one domain | Limited to the listed services, but the front-end admin decides |
| Resource-based constrained (RBCD) | The owner of the back-end account, on the back-end object | Impersonation only by the front-end accounts listed there; can cross domains | Control sits with the resource owner, so a risky front end is easy to refuse |
Microsoft's description of the 2012 change: it moves the decision about trusting a delegating front end from the front end's domain administrator to the resource owner. Concretely, classic delegation is edited on the front end's object, and changing it needs the "Enable computer and user accounts to be trusted for delegation" right, which Domain Admins hold by default. Resource-based delegation is edited on the SQL account's object, so the SQL owner alone decides which front ends may reach it, without involving the front end's administrators.
Same domain: steps
- Run the web application's pool or service as a group managed service account (gMSA, a domain account whose password the directory rotates); IIS application pools and Windows services can use one.
- Register the SQL SPN on the account that runs SQL Server, for example
setspn -S MSSQLSvc/sqlhost.corp.example.com:1433 CORP\sqlsvc. If the SPN is missing or wrong, Kerberos is not used at all, so delegation cannot happen. - Configure delegation to exactly that SPN (classic), or set the allowed front end on the SQL account (RBCD). For classic, edit the front end's object. In Active Directory Users and Computers this is the Delegation tab with "Trust this user for delegation to specified services only"; in PowerShell:
# Classic: set on the FRONT END account (here the gMSA 'webapp'); lists the one SPN it may delegate to.
Set-ADServiceAccount -Identity 'webapp' -Add @{ 'msDS-AllowedToDelegateTo' = 'MSSQLSvc/sqlhost.corp.example.com:1433' }
Get-ADServiceAccount -Identity 'webapp' -Properties 'msDS-AllowedToDelegateTo' | Select-Object Name, 'msDS-AllowedToDelegateTo'
Illustrative read-back (not a captured run): webapp with {MSSQLSvc/sqlhost.corp.example.com:1433} in the second column means the front end may delegate to that service and nothing else. For RBCD in one domain, use the same Set-ADUser ... -PrincipalsAllowedToDelegateToAccount form shown in the cross-domain section, with both accounts in the same domain.
4. If the web application authenticates users by a method other than Kerberos (forms login, certificates), it needs protocol transition. Example: Bob types a username and password into a web form, so the application never receives a Kerberos ticket for Bob. It must ask the domain controller to produce a ticket for Bob without his password, and the domain controller only does that for a front end that is allowed to. Classic constrained delegation needs the Trusted-to-Authenticate-for-Delegation setting for that (in Users and Computers: "Use any authentication protocol" instead of "Use Kerberos only"; in PowerShell Set-ADAccountControl -Identity 'webapp$' -TrustedToAuthForDelegation $true). With RBCD the KDC (Key Distribution Center, the domain controller's Kerberos service) always allows it, so the back end can still tell how the user was authenticated: the ticket carries one of two well-known SIDs. S-1-18-1 (authentication authority asserted identity) means a domain controller verified the user directly. S-1-18-2 (service asserted identity) means the front end vouched for the user through protocol transition. A back end can require S-1-18-1 in an access check for sensitive data, so that a user who was only vouched for by a service is refused.
5. Protect the users: members of Protected Users (a built-in group whose members get hardened sign-in rules, including that their credentials cannot be delegated) and accounts marked "Account is sensitive and cannot be delegated" cannot be delegated. That is a feature, and administrators will see failures through this application.
If the services are in different domains
Classic constrained delegation restricts the account to a single domain. Resource-based delegation lets the owner of the SQL account in domain B list the front-end account from domain A:
# Front end: gMSA "webapp" (domain A). Back end: SQL Server service account "sqlsvc" (domain B).
# Delegation is configured on the BACK END object and lists the front end that may impersonate users to it.
$front = Get-ADServiceAccount -Identity 'webapp' -Server 'dc01.a.example.com'
Set-ADUser -Identity 'sqlsvc' -Server 'dc01.b.example.com' -PrincipalsAllowedToDelegateToAccount $front
# Read it back from the back-end object.
Get-ADUser -Identity 'sqlsvc' -Server 'dc01.b.example.com' -Properties PrincipalsAllowedToDelegateToAccount |
Select-Object Name, PrincipalsAllowedToDelegateToAccount
This script was parse-checked with PowerShell 7 and its cmdlets and parameters checked against Microsoft Learn. It was not run, because it needs the ActiveDirectory module and two real domains. It assumes the domains already trust each other.
Verify it works
Run a test through the web application, from a client other than the SQL server, and read the connection that SQL sees:
SELECT c.auth_scheme, s.login_name
FROM sys.dm_exec_connections AS c
JOIN sys.dm_exec_sessions AS s ON s.session_id = c.session_id
WHERE c.session_id = @@SPID;
You expect KERBEROS and the end user's name. Illustrative result for a test as Alice (not a captured run):
auth_scheme login_name
----------- ----------
KERBEROS CORP\alice
If the first column says NTLM, or the login name is the application's account, the Kerberos second hop did not happen. SQL Server's own documentation notes that local connections use NTLM, so test remotely.
Trade-offs and pitfalls
- If the queries do not need per-user identity, have the application use its own identity and enforce per-user rules in code (the trusted subsystem model: the database trusts the application's identity, and the application decides who may do what). That removes delegation entirely.
- Delegation lists grow stale: audit them, and remove entries when an application is retired.
- Clocks, DNS and a correct SPN are the usual failures, not the delegation setting.
Two companies need limited resource access between their separate forests. How would you set up the trust, and how do you keep the other resources in the second forest out of reach?
Sample Answer
Direct answer
Create a one-way, outgoing forest trust from the forest that owns the resources (the trusting forest) to the partner's forest (the trusted forest). Make DNS name resolution work first, switch the trust to selective authentication, and then grant the Allowed to Authenticate permission only on the specific server computer objects the partner may use. A forest is the top-level security boundary of Active Directory, so the goal is to open one narrow door and keep every other door locked.
A trust points the opposite way from the access it allows: if users in partner.example must reach a file server in corp.example, corp.example trusts partner.example. That is an outgoing trust on the corp.example side.
Build it in this order
1. Prerequisites. A forest trust is built and used with the DNS names of both forests; Microsoft's trust documentation states that access by NetBIOS name across a forest trust is not supported. Selective authentication on a forest trust needs the trusting forest, where the shared resources live, at the Windows Server 2003 forest functional level or higher (the forest functional level is a setting that records the oldest Windows Server version allowed on the forest's domain controllers and unlocks forest-wide features). The minimum rights are Enterprise Admins in the trusting forest, or Domain Admins in the forest root domain.
2. Name resolution. Each forest's DNS servers must be able to find the other forest's domain controllers. Microsoft's prerequisites for creating a forest trust list three arrangements: a shared root DNS server whose root zone delegates to both namespaces (with the root hints of all DNS servers updated), conditional forwarders in each namespace (a DNS server forwards queries for one named domain to a chosen server), or secondary zones in each namespace with zone transfers. With no shared root, prefer conditional forwarders: they are simpler to troubleshoot, and a secondary zone copies every host record of the partner zone to you.
# Run on a DNS server in corp.example. Mirror the command in partner.example.
# 10.50.0.10 and 10.50.0.11 are the partner's DNS servers (example addresses).
Add-DnsServerConditionalForwarderZone -Name "partner.example" `
-MasterServers 10.50.0.10,10.50.0.11 -ReplicationScope "Forest"
# Prove the partner's domain controller locator records resolve before building the trust.
# An SRV (service locator) record is a DNS record that names the servers offering one service.
Resolve-DnsName -Name "_ldap._tcp.dc._msdcs.partner.example" -Type SRV
The _ldap._tcp.dc._msdcs.<domain> name is the service locator (SRV) record that domain controllers register so clients can find them. If it does not resolve, the trust wizard will fail, so fix DNS before anything else.
A healthy answer looks like this (illustrative output, not a captured run):
Name Type TTL Section NameTarget Priority Weight Port
---- ---- --- ------- ---------- -------- ------ ----
_ldap._tcp.dc._msdcs.partner.example SRV 600 Answer dc1.partner.example 0 100 389
Read it as: NameTarget is a partner domain controller that clients can use, and Port 389 is the directory (LDAP) port it listens on. A failure prints an error such as "DNS name does not exist" instead of a table, which means your DNS server cannot find the partner's records yet.
3. Create the trust. netdom trust cannot create a forest trust between two forests. Use Active Directory Domains and Trusts: right-click the forest root domain, open Properties, and use the Trusts tab to run the New Trust Wizard. Choose a forest trust, one-way outgoing from corp.example, and select selective authentication when the wizard asks for the authentication level. A one-way trust has two sides, an outgoing side in corp.example and an incoming side in partner.example: with administrator credentials for both forests the wizard can create both sides in one pass (the Sides of Trust page), otherwise the partner's administrator creates the incoming side.
4. Selective authentication. The default for a forest trust is forest-wide authentication, which lets any user in the partner forest authenticate to any server in your forest. Selective authentication reverses that default: nobody from the partner authenticates anywhere unless explicitly allowed. If you did not pick it in the wizard, set it from the command line, then read the state back (run without a value, the same switch displays the current setting). Microsoft documents the set command at Learn (Enable Selective Authentication over a Forest Trust):
netdom trust corp.example /domain:partner.example /SelectiveAUTH:Yes /userD:PARTNER\adminaccount /passwordD:*
netdom trust corp.example /domain:partner.example /SelectiveAUTH
To see the whole trust the way a reviewer would, read it from PowerShell on a DC in corp.example:
Get-ADTrust -Filter * | Format-List Name,Direction,ForestTransitive,SelectiveAuthentication,SIDFilteringQuarantined,TrustType
Name : partner.example
Direction : Outbound
ForestTransitive : True
SelectiveAuthentication : True
SIDFilteringQuarantined : False
TrustType : Uplevel
(Illustrative output, not a captured run.) Read-out: Direction : Outbound means corp.example trusts the partner, which is the direction you want; ForestTransitive : True marks a forest trust (transitive means the trust extends to every domain in both forests, not just the two root domains); SelectiveAuthentication : True is the goal state, and False means any partner user can still authenticate to any server; SIDFilteringQuarantined : False is normal for a forest trust because quarantine is the external-trust setting mentioned below.
5. Grant the one door. On each computer object that the partner needs (for example FS01), grant Allowed to Authenticate to the specific partner group, such as PARTNER\Project-Readers. The permission lives on the computer object in Active Directory, not on the server's own file permissions. In Active Directory Users and Computers on the trusting side: open View and tick Advanced Features, find the computer object (the Computers container or wherever it lives), right-click it and choose Properties, open the Security tab, click Add, type the partner group, then tick Allow beside Allowed to Authenticate and click OK. The same dialog is where you later audit who holds the door.
- For Kerberos, grant it on the computer account when the service runs as Local System or Network Service. If the service runs as a domain service account, grant it on that account.
- For NTLM (the older challenge-response sign-in protocol), grant it on the computer account even if the service uses a domain account.
- By default only Account Operators, Administrators, Domain Admins, Enterprise Admins and SYSTEM can edit this permission.
Why the other servers stay out of reach
When a partner user asks for a Kerberos service ticket (the credential a client presents to one specific server), the request reaches a domain controller in your forest. With selective authentication on, that domain controller tags the request with the Other Organization SID and checks Allowed to Authenticate on the target computer object. A SID (security identifier) is the unique ID Windows stores in a sign-in token for each user and group, and the Other Organization SID (S-1-5-1000) is a fixed, well-known one that means "this user comes from outside our forest". No permission means no service ticket, so the server is never contacted. A server such as FS02, where nobody granted the permission, is unreachable even if its share permissions were sloppy.
Add two more layers, because authentication is not authorization:
- Put the partner group, not "Authenticated Users", on the share and NTFS permissions of
FS01. Microsoft recommends removing the default Authenticated Users access on shared resources in the trusting forest, since a partner user who is let in still receives that SID once the member server authenticates them. The reason is that Authenticated Users (S-1-5-11) is a well-known group Windows adds to the token of every account that signs in successfully, whichever forest it comes from. "Let in" (passed Allowed to Authenticate) and "allowed to read" (share and NTFS permissions) are separate checks, so any share that grants Authenticated Users admits every partner user who gets through the door. - Keep the permission group-based and owned by the resource owner, so adding or removing a partner person is a membership change in their forest.
SID filtering, UPN suffixes and name routing
- SID filtering removes any SID from a request that does not belong to the trusted domain. It is already on by default for forest trusts. Its effect on a partner: users migrated into their domain with SID history (old SIDs kept on the account) lose access that was granted to the old SID, and a universal group (a group usable anywhere in a forest, with its membership held in the global catalog) works only if it was created in the trusted domain. Do not apply SID filter quarantine (
/quarantine) to a forest trust; that setting is meant for external trusts. Leave/enablesidhistoryoff unless you trust the partner's administrators, and read its state withnetdom trust corp.example /domain:partner.example /enablesidhistory. - UPN suffixes (the part after the @ in a user principal name) are routed by the forest trust. If both forests use the same suffix there is a name-suffix conflict, and the conflicting entry stays disabled until the other side's entry is disabled. List the routed suffixes with
netdom trust corp.example /domain:partner.example /namesuffixesand fix the overlap before the trust goes live.
Safe test and post-implementation audit
- Test with two partner accounts: one inside
Project-Readers, one outside. The member opens\\FS01\share; the non-member is refused at the ticket stage. Both are refused onFS02. - Verify the trust with
netdom trust corp.example /domain:partner.example /verify /userd:PARTNER\adminaccount /passwordd:*. - Audit after go-live: list trusts with
Get-ADTrust -Filter *, re-read the selective authentication and SID history settings, and review which computer objects carry Allowed to Authenticate and for whom. Repeat on a schedule, because the permission list is the real boundary.
Trade-offs and pitfalls
- A forest trust is transitive (it reaches every domain of both forests, not just the two forest root domains), so without selective authentication the exposure is the whole of your forest, not one server.
- If you grant only the computer object and forget the service account (Kerberos with a domain service account), users get repeated access denied even though the share looks right.
- Selective authentication can confuse users who browse the partner network and see access denied on servers that used to open; tell them in advance.
- If you only need to share files with a handful of people, a trust may be too much: a managed file-share or guest-invitation product avoids joining the two directories at all. Choose the trust when the access is ongoing, uses Windows authentication, and needs Kerberos.
You must allow limited resource access among three separate forests while keeping most resources isolated. Propose a trust topology, justify the direction and type of each trust, and explain the security risks each trust introduces and how you contain them.
Sample Answer
Direct answer
Use forest trusts, one-way, between a resource forest and each account forest that needs it, with selective authentication turned on, and create no trust between the two forests that should stay isolated. Forest trusts are transitive inside the two forests they join (transitive here means the trust covers every domain in both forests, not only the two root domains where it was created) but they do not chain onward to a third forest, so isolation of the third is the default, not something you bolt on. Then contain each trust with selective authentication (outside users may sign in only to computers you name), SID history disabled (old identifiers from migrated accounts are ignored), delegation blocked (a service cannot act as the user on other servers) and tight group design. Each of these is explained where it is used below.
Scenario and topology
Contoso (contoso.com, forest A) runs the shared file servers and an application. Fabrikam (fabrikam.com, forest B) is an acquired company whose users need the Contoso application. Wingtip Toys (wingtiptoys.com, forest C) hosts one lab application that Contoso users must reach. B and C must not see each other's resources.
| Trust | Direction | Type | Why |
|---|---|---|---|
| T1 | Contoso trusts Fabrikam (Contoso is the trusting, resource forest; Fabrikam is the trusted, account forest) | Forest trust, one-way | Fabrikam users reach Contoso resources; Contoso users gain nothing in Fabrikam |
| T2 | Wingtip trusts Contoso (Wingtip is trusting; Contoso is trusted) | Forest trust, one-way | Contoso users reach the Wingtip lab app; Wingtip users gain nothing in Contoso |
| none | Fabrikam and Wingtip | n/a | Forest trusts are not extended to a third forest. B and C have no path to each other |
Check: Fabrikam can reach only Contoso resources, Contoso users can reach Wingtip resources, and Fabrikam cannot reach Wingtip because T1 and T2 are separate forest trusts. If B and C later need to share, a separate trust between them is required.
Direction in plain terms
In a one-way trust the users come from the trusted forest and the resources live in the trusting forest. Draw the arrow of access from account forest to resource forest, then check you have not given the reverse. For this design the arrows are:
Fabrikam (accounts) ---> Contoso (resources) T1: Contoso is trusting, Fabrikam is trusted
Contoso (accounts) ---> Wingtip (resources) T2: Wingtip is trusting, Contoso is trusted
Fabrikam x Wingtip no trust, so no arrow and no path
Read each arrow as "people from here can use things over there". The forest at the arrow head is the one that trusts; it is the one that decides who may touch its servers.
Terms used below. Forest trust: a trust between the root domains of two whole forests, covering every domain in each (a plain domain trust, called an external trust, covers only the two domains it joins). ACE: access control entry, one line in a permission list that names a user or group and what it may do. Domain local group: a group that can be used in permissions only inside its own domain, but can contain accounts and global groups from trusted forests. Global group: a group that holds accounts from its own domain and can be used in permissions in any trusted domain. Tier 0: the accounts and servers that control identity itself, such as domain controllers and the accounts that administer them. Allowed to authenticate: a permission on a computer object in the trusting forest that lets one named outside user or group sign in to that computer when selective authentication is on.
Prerequisites and creation
- DNS. A forest trust needs one of: a shared root DNS server for both namespaces, conditional forwarders in each forest for the other namespace, or secondary zones.
- Permissions. Domain Admins of the forest root domain or Enterprise Admins create the trust. A password is set between the sides. Enterprise Admins in both forests can create both sides at once with a generated password. The
netdom trustcommand cannot create a forest trust, so use the Active Directory Domains and Trusts snap-in. - Trust password rotation. The trusting domain's PDC emulator changes the trust password every 30 days.
Risk specific to each trust
- T1: Fabrikam's administrators and any compromise of Fabrikam accounts become a route into Contoso. Contain it with selective authentication limited to
app01, SID history off and no administrative use of Fabrikam accounts on Contoso hosts. - T2: a compromised Contoso account can reach the Wingtip lab application. Contain it with selective authentication on Wingtip's outbound trust, access granted only to one Contoso group, and no Contoso admin accounts used there.
Risks every trust introduces and how to contain them
| Risk | Containment |
|---|---|
| Accounts from the trusted forest are treated as authenticated in the trusting forest, so a broadly granted "Authenticated Users" ACE includes them | Turn on selective authentication on the outgoing side, then grant "Allowed to authenticate" on only the specific computer objects, then grant resource permissions to groups |
| SID history (old identifiers carried over when an account was migrated between domains) can grant access the trusting forest never intended | Keep SID history disabled with netdom trust ... /enablesidhistory:No unless you trust the other forest's administrators |
| A privileged trusted-forest account used on trusting-forest hosts | Do not use admin accounts across trusts; keep Tier 0 separate |
| Kerberos delegation across the trust (a service acting as the user on other servers) | Disable full delegation on outbound trusts with /enabletgtdelegation:No |
| Stale or unmonitored trusts | Verify with netdom trust ... /verify; review annually; remove unused trusts |
| Compromise of the trusted forest | Treat the trusted forest as part of the trusting forest's attack surface; the controls above limit blast radius, they do not remove it |
Selective authentication applies on outbound forest and external trusts; the forest-wide alternative gives outside users the same level of access as local users, which is exactly what you do not want here.
netdom trust contoso.com /domain:fabrikam.com /SelectiveAUTH:Yes /userD:FABRIKAM\admin /passwordD:*
netdom trust contoso.com /domain:fabrikam.com /enablesidhistory:No /userD:FABRIKAM\admin /passwordD:*
netdom trust contoso.com /domain:fabrikam.com /enabletgtdelegation:No /userD:FABRIKAM\admin /passwordD:*
netdom trust contoso.com /domain:fabrikam.com /verify /userD:FABRIKAM\admin /passwordD:*
Repeat on the wingtiptoys.com side for T2 with the arguments reversed.
What each line does. The first name after netdom trust is the trusting forest, /domain: is the trusted one, and /userD with /passwordD:* is an administrator of the trusted domain whose password is prompted for instead of typed on the line.
/SelectiveAUTH:Yesturns on selective authentication: outside users can sign in only to computers where they hold Allowed to authenticate./enablesidhistory:Nomakes the trusting forest ignore SID history in tickets from the other forest./enabletgtdelegation:Noblocks Kerberos full delegation across the trust, so a service in the other forest cannot receive a forwardable copy of a user's ticket-granting ticket./verifychecks that the trust password (the shared secret) matches on both sides.
The Microsoft reference says /SelectiveAUTH and /enablesidhistory are valid only on outbound forest trusts (and external trusts for selective authentication), which is why they run on the trusting side.
Illustrative shape of a successful /verify (not captured from a live run; the exact wording varies by Windows version):
The trust between contoso.com and fabrikam.com has been successfully verified.
The command completed successfully.
Read it as: the secret on both sides agrees and each side can reach a domain controller of the other. A failure prints an error instead, most often a name resolution, firewall or RPC problem, which is what to check after a network change.
Worked example
A Fabrikam finance user needs the Contoso application on server app01. Fabrikam adds the user to FAB-Finance-Global. In Contoso, app01 has "Allowed to authenticate" granted to FAB-Finance-Global, a Contoso domain local group APP-Users contains FAB-Finance-Global, and the application ACL grants APP-Users. The same user cannot reach fileserver01 in Contoso: the account is trusted, but not allowed to authenticate to that computer. Here FAB-Finance-Global is a global group (it holds Fabrikam accounts), APP-Users is a domain local group (it is used in the application's ACE), and putting the first inside the second is the usual pattern across a trust.
Trade-offs
- Selective authentication adds administrative work for every new server.
- Two separate trusts are easier to reason about than a hub that implies reach.
Walk through what happens, step by step, when a domain user logs on to a workstation and then opens a file share. Where does Kerberos fit, and when would NTLM be used instead?
Sample Answer
Direct answer
At sign-in the workstation finds a domain controller (DC), and the Kerberos client proves the user's identity to the Key Distribution Center (KDC, the ticket-issuing service on every DC). The reply is a ticket-granting ticket (TGT). When the user opens a file share, the client presents the TGT to the KDC and asks for a service ticket for that file server, then presents that service ticket to the server, which can authenticate the user without calling a DC. Kerberos is the default in a domain. NTLM (NT LAN Manager, the older challenge-response protocol) is used when Kerberos cannot be: a workgroup computer or local account, a server addressed by IP address, a server whose service principal name (SPN) is not registered, or a client and server with no shared domain or trust.
Step by step
| # | Step | What happens |
|---|---|---|
| 1 | Find a DC | Netlogon queries DNS SRV records and pings candidate DCs; the result is cached |
| 2 | AS exchange (AS is the Authentication Service, the part of the KDC that issues TGTs) | The client sends KRB_AS_REQ to the KDC (port 88) and receives KRB_AS_REP containing a TGT, kept in the logon session's cache |
| 3 | Sign-in completes | The KDC used the Active Directory database as its account store; in a multi-domain forest a global catalog supplies universal group memberships |
| 4 | Name and SPN | Opening \fs01\data resolves fs01 in DNS; the client composes a service principal name from the server name it was given, for example (illustrative) cifs/fs01.corp.contoso.com: the service class cifs (file sharing), then the host name |
| 5 | TGS exchange (TGS is the Ticket-Granting Service, the part of the KDC that issues service tickets) | The client sends KRB_TGS_REQ with its TGT and receives KRB_TGS_REP, a service ticket encrypted so only the target service's account can read it |
| 6 | AP exchange (AP is Application, the exchange with the target service) | The client sends KRB_AP_REQ to the file server (SMB, port 445). The server decrypts the ticket, checks the timestamp, builds an access token (the list of the user's SID and group SIDs that Windows checks against permissions) and compares it with the share's access control lists. The server calls a DC only if it needs to validate the Privilege Attribute Certificate (PAC, the authorisation data in the ticket) |
| 7 | Reuse | The client keeps the TGT and each service ticket and reuses them until they expire |
Defaults and limits in the domain's Kerberos policy: maximum lifetime for a user ticket 10 hours; maximum lifetime for ticket renewal 7 days; maximum tolerance for computer clock synchronisation 5 minutes. A user who signs in at 08:00 on Monday has a TGT ending at 18:00 Monday and renewable until 08:00 the following Monday. If the client clock differs from the DC by more than 5 minutes, tickets are rejected, which is why a laptop with a wrong clock suddenly cannot sign in while its password is correct.
When NTLM is used
| Situation | Why Kerberos is not used |
|---|---|
| Workgroup computers; local logon on non-DCs | There is no domain account or KDC to issue tickets |
| Server addressed by IP address | The client builds the SPN from a host name, so an IP address typically forces NTLM |
| SPN not registered or registered on the wrong account | The DC cannot issue a ticket for an unknown SPN, so the client falls back to NTLM. Microsoft's Negotiate documentation says Kerberos is chosen unless it cannot be used by one of the systems involved or the calling application gave too little information to use it |
| Client and server in unrelated domains or forests without a trust | No shared KDC path |
| An application that chooses NTLM | Some applications still request it |
Why NTLM is legacy
- With NTLM the resource server must contact a DC (or its local account database) every time a new access token is needed, which is called pass-through authentication. With Kerberos the service ticket carries the authorisation data, so the server can usually authenticate the user without that round trip.
- NTLM does not let the client verify the server's identity (no mutual authentication: a Kerberos server proves it can decrypt the ticket, so the client knows it reached the real server). With NTLM an impostor server on the path can accept the challenge-response exchange, so the client cannot tell the difference.
- Challenge-response means the server sends a random challenge and the client answers with a value computed from the password, so the password itself is not sent and no ticket exists that the server can verify by itself.
- A workgroup computer, mentioned in the table above, is one that is not joined to a domain and keeps its own local accounts.
- Reduction needs an audit of which applications use it, then selective restriction.
Diagnosing from the client
klist purge
net use \\fs01.corp.contoso.com\data
klist
klist purge destroys every cached ticket in the session and can leave you unable to authenticate until you sign out and in again, so use it on a test session. After the share is opened by name, klist lists cached tickets with Client, Server, Start Time, End Time and Renew Time; the file server should appear in the Server column.
Illustrative klist output taken just after 08:10 in the worked example below, in a session where klist purge had not been run (abbreviated, invented values). If you run the three commands above in order and the session survives the purge, the TGT in your list is a newly issued one, so its Start Time is the time of the purge rather than 08:00 (if the purge leaves the session unable to authenticate, there is no TGT to list until you sign out and in):
Current LogonId is 0:0x3e4a1
Cached Tickets: (2)
#0> Client: jdoe @ CORP.CONTOSO.COM
Server: krbtgt/CORP.CONTOSO.COM @ CORP.CONTOSO.COM
Start Time: 8/3/2026 8:00:12 End Time: 8/3/2026 18:00:12
Renew Time: 8/10/2026 8:00:12
#1> Client: jdoe @ CORP.CONTOSO.COM
Server: cifs/fs01.corp.contoso.com @ CORP.CONTOSO.COM
Start Time: 8/3/2026 8:10:40 End Time: 8/3/2026 18:00:12
Ticket 0 is the TGT (the server name is krbtgt), ticket 1 is the service ticket for the file server. Its End Time is capped at the TGT's end, which is why the two end together here. klist tgt shows the TGT with StartTime, EndTime, RenewUntil and TimeSkew against the KDC. Repeat with \\10.0.0.20\data and compare: if no new ticket for the server appears, that session did not use Kerberos.
The secure channel is the machine's own authenticated link to the domain, built with the computer account's password. If it is broken the machine cannot authenticate any domain user even though the network and clock are fine, so this check separates a broken computer account from a Kerberos or NTLM question.
# On the workstation, elevated: verifies the secure channel to the domain
if (-not (Test-ComputerSecureChannel -Verbose)) {
Write-Warning 'The secure channel to the domain is broken.'
}
When a group change takes effect
The user's group SIDs are carried in the PAC inside the tickets issued at sign-in. A user added to a group at 10:00 therefore typically gets the new access only after new tickets are issued: signing out and in, or waiting until the existing tickets expire (up to the 10 hour TGT lifetime in the default policy). The same mechanism is why removing someone from a group or disabling an account does not cut off tickets already issued.
Worked example
A user signs in at 08:00 Monday on a laptop and opens \fs01\data at 08:10. klist shows the TGT for krbtgt and, after the share is opened, a service ticket for the file server. At 08:30 the same user opens \10.0.0.20\data, the same server by IP, and typically no new ticket appears; that connection used NTLM. A week later the laptop's clock drifts 7 minutes fast: w32tm /stripchart /computer:dc-chi1 /samples:3 /dataonly shows an offset above 5 minutes, and sign-in fails until w32tm /resync /rediscover corrects it.
Pitfalls
- Believing "Kerberos always works" and ignoring that an IP address in a path typically gets NTLM instead of a ticket.
- Blaming the password when the clock is the cause.
- Restricting NTLM before auditing, which breaks applications that still depend on it.
- Forgetting that a disabled account's existing tickets remain valid until they expire.
Unlock Full Question Bank
Get access to all 11 Active Directory Architecture and Management interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.