Active Directory

Fix the PowerShell Second-Hop Problem with Kerberos Resource-Based Constrained Delegation (Windows Server 2025)

Aseem Kishore
14 min read

The Back Room Tech is reader-supported. We may earn a commission when you buy through links on our site. Learn more.

Your remoting session to ServerB works. Commands on ServerB work. Then a command in that session tries to reach a share on ServerC and gets Access is denied, even though your account has full rights on ServerC. That’s usually the PowerShell second-hop problem, not an ACL fault. By default, Kerberos doesn’t pass your credentials from ServerB on to ServerC.

The fix is resource-based Kerberos constrained delegation (RBCD). You set it on ServerC’s computer object, which is the resource side. You don’t need Domain Admin, CredSSP, or unconstrained delegation. This runbook covers proof, fix, checks, and rollback. It also covers the 15-minute ticket-cache trap behind most “I set up RBCD and it still fails” reports.

Prerequisites

  • Active Directory Domain Services, with ServerB (jump/management server) and ServerC (resource server) both joined to the domain.
  • Windows Server 2025 on the servers. Microsoft lists RBCD as available since Windows Server 2012. The cmdlets and attribute names are the same on 2025 (Microsoft Learn: Making the second hop).
  • The RSAT-AD-PowerShell feature and the ActiveDirectory module on the machine that runs the AD commands. It doesn’t have to be ServerB or ServerC.
  • Delegated permission to write the msDS-AllowedToActOnBehalfOfOtherIdentity attribute on ServerC’s computer object (or an equivalent delegated right your AD team grants). RBCD needs this specific permission on the resource object, not Domain Admin membership. Some organizations scope it more tightly than a generic write on the object.
  • Local admin on ServerB, needed only for the ticket-cache purge. The diagnosis and test commands don’t require it.

Names used throughout: ServerA = your workstation, ServerB = the first-hop server, ServerC = the resource, CONTOSO\Alice = the admin account.

Quick Diagnosis: Prove It’s the Second Hop

Before you touch AD, confirm the second hop is the real problem. Several other faults throw the same “Access is denied” text.

1. Reproduce the failure through remoting

Run this on ServerA:

$cred = Get-Credential CONTOSO\Alice
Invoke-Command -ComputerName ServerB -Credential $cred -ScriptBlock {
    Get-ChildItem "\\ServerC\Share"   # this is the second hop: ServerB -> ServerC
}

You’ll get an “Access is denied” error back from ServerB. UNC failures can also show up as a “path does not exist” error.

PowerShell console on ServerA showing the Invoke-Command -ComputerName ServerB line and the red Access is denied error returned for Get-ChildItem against \\ServerC\Share

2. Run the same command without the hop

Sign in to ServerB as CONTOSO\Alice over RDP or the console. Then run this:

Get-ChildItem "\\ServerC\Share"

Run the same line on ServerA too. If both work, Alice’s rights on ServerC are very likely fine for that share, and the failure only shows up when ServerB acts for Alice. That’s the second-hop pattern. It’s strong evidence rather than proof, so keep name resolution and the exact share path identical across all three tests.

3. Look at the ticket cache inside the remote session

Invoke-Command -ComputerName ServerB -Credential $cred -ScriptBlock { klist }

Compare it with klist from an interactive logon on ServerB. A default remoting session typically doesn’t receive forwarded credentials, so ServerB usually can’t obtain a ticket for ServerC on your behalf. The cache contents depend on the logon context and any existing tickets, so treat klist as supporting evidence, not proof. Save your own before-and-after for the change record.

klist output run inside an Invoke-Command session on ServerB, showing the Kerberos ticket cache state before any RBCD change

4. Rule out general Kerberos faults

If step 2 also fails, you’ve got something other than the second hop. Check first for missing or duplicate SPNs, clock skew past the Kerberos limit, or an NTLM fallback. Our Kerberos SPN and time-skew triage guide covers those. This runbook assumes they’re clean.

Symptoms at a Glance

SymptomLikely CauseQuick Fix
Access denied only when going through ServerBKerberos second hopSet up RBCD on ServerC
RBCD set, still denied right awayCached denial on ServerB (up to 15 min)klist purge -li 0x3e7 on ServerB
RBCD set, nothing ever changesSet on ServerB instead of ServerCRe-run Set-ADComputer on ServerC
Works to a share, fails to Invoke-Command ServerCRBCD doesn’t support a further WinRM hopUse explicit credentials for that leg
One account never delegatesSensitive flag / Protected Users (per CredSSP/legacy delegation docs)By design. Use another method
Get-ADComputer not recognizedAD module missingInstall RSAT-AD-PowerShell

Common Issues and Solutions

Problem: Access Is Denied Reaching a Third Server

Symptoms:

  • Invoke-Command to ServerB works for local tasks.
  • Any call from ServerB to ServerC’s share fails with Access is denied.
  • The same call works from an interactive logon.

Why it happens: ServerB signed you in with Kerberos. It has no right to ask for tickets to ServerC on your behalf. RBCD grants exactly that right, scoped to one resource.

Fix: Run these on any management host with the AD module. You need write rights on ServerC’s computer object.

# One-time: install and load the AD module (Windows Server)
Add-WindowsFeature RSAT-AD-PowerShell
Import-Module ActiveDirectory

# Confirm the delegation parameter exists in this module version
Get-Command -ParameterName PrincipalsAllowedToDelegateToAccount
$ServerB = Get-ADComputer -Identity "ServerB"   # the server that delegates (jump box)
$ServerC = Get-ADComputer -Identity "ServerC"   # the resource being accessed

# Set ON ServerC: "ServerB may delegate to me"
Set-ADComputer -Identity $ServerC -PrincipalsAllowedToDelegateToAccount $ServerB

Set-ADComputer returns nothing when it works. Silence is what you want. Under the hood, it writes the msDS-AllowedToActOnBehalfOfOtherIdentity attribute on ServerC.

Verify:

# Friendly property
Get-ADComputer -Identity $ServerC -Properties PrincipalsAllowedToDelegateToAccount |
    Select-Object Name, PrincipalsAllowedToDelegateToAccount

You should see ServerB’s distinguished name, like this:

Name    PrincipalsAllowedToDelegateToAccount
----    ------------------------------------
ServerC {CN=ServerB,OU=Servers,DC=contoso,DC=com}

The friendly property above is the simplest way to confirm which principals are listed, and it’s enough for most changes. As an optional, advanced step, you can inspect the raw security descriptor behind it, but the attribute comes back as a byte array, not a ready-made ACL object, so convert it first.

$x = Get-ADComputer -Identity $ServerC -Properties msDS-AllowedToActOnBehalfOfOtherIdentity
$sd = New-Object System.DirectoryServices.ActiveDirectorySecurity
$sd.SetSecurityDescriptorBinaryForm($x.'msDS-AllowedToActOnBehalfOfOtherIdentity')
$sd.Access   # look for an Allow entry for CONTOSO\ServerB$

This should return the same answer as the friendly-property check, so use it only as a backup if that check gives an unexpected result.

Set-ADComputer -Identity $ServerC -PrincipalsAllowedToDelegateToAccount $ServerB returning silently, followed by Get-ADComputer output listing CN=ServerB in PrincipalsAllowedToDelegateToAccount

Problem: RBCD Configured, Still Access Denied

Symptoms:

  • Both check commands show ServerB correctly.
  • The second hop still fails for several minutes.

Why it happens: Say ServerB tried the call to ServerC before you added the delegation. That failure can stay cached for up to 15 minutes. Microsoft’s guide calls this out (Microsoft Learn). It’s the top reason people think RBCD “doesn’t work.”

Fix: You’ve got three options. Wait 15 minutes, reboot ServerB, or purge the Local System logon session’s tickets on ServerB. The purge needs admin rights on ServerB.

Invoke-Command -ComputerName ServerB -Credential $cred -ScriptBlock {
    klist purge -li 0x3e7   # -li targets a logon ID; 0x3e7 = Local System (the computer account)
}

A typical result looks like this. The exact wording can vary by build:

Current LogonId is 0:0x...
Targeted LogonId is 0:0x3e7
        Deleting all tickets:
        Ticket(s) purged!
klist purge -li 0x3e7 run on ServerB showing the Targeted LogonId 0x3e7 and Ticket(s) purged confirmation, with klist output before and after

Verify: Re-run the first test from ServerA.

Invoke-Command -ComputerName ServerB -Credential $cred -ScriptBlock {
    Get-ChildItem "\\ServerC\Share"
}

You should now get a normal folder listing, provided the rest of the path is healthy. RBCD fixes only the delegation part. Share and NTFS permissions, DNS, SPNs, the firewall and SMB itself still have to be right.

Successful Get-ChildItem listing of \\ServerC\Share returned through the Invoke-Command session on ServerB after RBCD and the ticket purge

Problem: Delegation Set on the Wrong Object

Symptoms:

  • You ran Set-ADComputer and purged tickets.
  • Waiting doesn’t help.
  • Get-ADComputer ServerC -Properties PrincipalsAllowedToDelegateToAccount comes back empty.

Why it happens: Legacy constrained delegation lives on the delegating server (ServerB). RBCD runs the other way. You set it on the resource (ServerC). It’s an easy mix-up. If you wrote ServerC into ServerB’s attribute, you allowed the wrong direction.

Fix: First check whether ServerB has any other legitimate entries, since the cleanup command below clears its entire delegation list, not just the mistaken one.

# Snapshot ServerB's current list before changing anything
Get-ADComputer -Identity $ServerB -Properties PrincipalsAllowedToDelegateToAccount |
    Select-Object -ExpandProperty PrincipalsAllowedToDelegateToAccount

If ServerC is the only entry, or you’ve saved the snapshot above, clear ServerB and set up ServerC:

# Remove the mistaken entry from ServerB (this clears its whole delegation list)
Set-ADComputer -Identity $ServerB -PrincipalsAllowedToDelegateToAccount $null

# Apply to the resource
Set-ADComputer -Identity $ServerC -PrincipalsAllowedToDelegateToAccount $ServerB

If the snapshot showed other principals that still need delegation from ServerB, pass them all back in together instead of using $null:

Set-ADComputer -Identity $ServerB -PrincipalsAllowedToDelegateToAccount @($OtherLegitimateServer)

Verify: Run the Get-ADComputer check against ServerC and against ServerB to confirm the list on each one matches what you intended. Then purge tickets on ServerB and test again.

Problem: Works for File Shares, Fails for a Further Invoke-Command

Symptoms:

  • Get-ChildItem \\ServerC\Share works through ServerB.
  • Invoke-Command -ComputerName ServerC from inside the ServerB session is denied.

Why it happens: Microsoft documents that RBCD doesn’t support the second hop for WinRM (Microsoft Learn). SMB share access doesn’t use WinRM, so it can work once RBCD is in place, as long as the share’s permissions, SPNs and Kerberos path are otherwise sound. Chained remoting is a WinRM hop, so it fails.

Fix: For that one leg, pass credentials directly:

$cred = Get-Credential CONTOSO\Alice
Invoke-Command -ComputerName ServerB -Credential $cred -ScriptBlock {
    # $using: passes the caller's PSCredential object into the remote scriptblock
    Invoke-Command -ComputerName ServerC -Credential $using:cred -ScriptBlock { hostname }
}

Verify: The output is ServerC.

Problem: One Account Never Delegates

Symptoms:

  • RBCD works for most admins.
  • One account (often a Tier 0 or service account) always fails.

Why it happens: Some accounts are flagged “Account is sensitive and cannot be delegated,” which blocks delegation outright. Others sit in the Protected Users group, which is documented to block common credential-delegation methods such as CredSSP and legacy constrained delegation.

Microsoft’s documentation for those restrictions doesn’t spell out every detail of the RBCD path specifically. Treat a failure on a flagged or Protected Users account as expected, but confirm the behavior for your specific scenario rather than assuming it will fail the same way everywhere.

Fix: Check the flags. Don’t remove them just to make a script run.

Get-ADUser -Identity Alice -Properties AccountNotDelegated, MemberOf |
    Select-Object Name, AccountNotDelegated, @{n='ProtectedUsers';e={$_.MemberOf -match 'CN=Protected Users'}}

Verify: If either value is True, use explicit credentials or JEA for that account.

Problem: No Rights to Configure RBCD

Symptoms: Set-ADComputer fails with an access-denied error against ServerC’s object.

Why it happens: RBCD doesn’t need Domain Admin. It needs permission to write msDS-AllowedToActOnBehalfOfOtherIdentity on ServerC’s computer object, or an equivalent right your directory’s ACL design grants.

Fix: Ask the AD team for delegated write on that computer object, or on the OU that holds your resource servers. Don’t ask for Domain Admin. Narrow rights like this are one of RBCD’s main design wins.

Error Messages Quick Reference

Error / OutputWhere You See ItMeaningAction
Access is denied (from ServerB)Inside Invoke-CommandNo delegation to ServerCRBCD on ServerC
Path does not exist (UNC)Inside remote sessionOften the same second-hop denialRun diagnosis step 2
The term 'Get-ADComputer' is not recognizedManagement hostAD module missingAdd-WindowsFeature RSAT-AD-PowerShell
Access denied on Set-ADComputerManagement hostNo write on ServerC objectAsk for delegated rights
Empty PrincipalsAllowedToDelegateToAccountCheck stepSet on wrong object or not appliedRe-run against ServerC

Platform-Specific Notes (Windows)

Windows Server 2025 vs. Earlier Versions

RBCD on Windows Server 2025 uses the same cmdlets, parameter, and attribute as Server 2012 and later. After patching, check Windows Server release information and the Server 2025 release health page for known issues. PowerShell is the documented way to set this up, so plan on using it.

Windows PowerShell 5.1 vs. PowerShell 7

The commands here run in Windows PowerShell 5.1, which ships with Windows Server 2025, and in current PowerShell 7 releases when the ActiveDirectory module is available. Depending on how the module is installed, it loads natively or through the Windows PowerShell compatibility layer. Check your own version with $PSVersionTable.PSVersion and note it in the change record.

Use Get-ChildItem or Test-Path against a UNC path as your test. Older examples use Get-Process -ComputerName or Get-EventLog -ComputerName. Those parameters and cmdlets aren’t available in PowerShell 7, so don’t build tests on them if you might run under 7.x.

Configuration Mistakes

Overwriting existing delegations. Treat the PrincipalsAllowedToDelegateToAccount parameter as if it replaces the existing list rather than appending to it, and verify the result after each change. To allow several jump servers, pass them all in one call:

$ServerB1 = Get-ADComputer -Identity "ServerB1"
$ServerB2 = Get-ADComputer -Identity "ServerB2"
Set-ADComputer -Identity $ServerC -PrincipalsAllowedToDelegateToAccount @($ServerB1, $ServerB2)

Forgetting the rollback path. Save the current value before you change it, so you can put it back:

# Snapshot before change
Get-ADComputer -Identity $ServerC -Properties PrincipalsAllowedToDelegateToAccount |
    Select-Object -ExpandProperty PrincipalsAllowedToDelegateToAccount

# Full rollback: remove all RBCD from ServerC
Set-ADComputer -Identity $ServerC -PrincipalsAllowedToDelegateToAccount $null

Warning: Setting the value to $null removes every allowed delegating principal on the target object, not just the one you meant to remove. Check the snapshot first, on whichever server (ServerB or ServerC) you’re about to clear.

Security Ranking: Pick the Right Fix

These rankings follow the options and trade-offs in Microsoft’s second-hop guide. They run from least to most preferred:

MethodSecurityVerdict
Unconstrained delegationWorst. ServerB gets a usable copy of your TGT for any serviceDon’t use
CredSSPPoor. Caches your credentials on ServerB. Off by default. Fails with Protected UsersAvoid as a fix
PSSessionConfiguration RunAsModerate. Needs RunAs password upkeep on every ServerBNiche
Legacy constrained delegationHigh. Needs Domain Admin, single domain, set on ServerBReplaced by RBCD
RBCDHigh. No credential caching, resource owner controls it, no Domain AdminDefault fix
JEAHighest potential. More setup per ServerBUse when you also need to limit commands
Explicit credentials in scriptblockNo server config at all. Operator handles a second credentialAd hoc and WinRM chains

Is CredSSP or unconstrained delegation ever fine? Not as the fix for this problem. If ServerB is compromised, either one hands an attacker reusable credentials. RBCD avoids that.

When to pick something other than RBCD:

  • Explicit credentials: one-off scripts, chained WinRM hops, or accounts that are sensitive or in Protected Users.
  • JEA: jump servers shared by many operators, where you also need to limit what runs on top of fixing credential forwarding (Ashley McGlone’s write-up has more background).

Getting Help

Before you escalate, collect the following:

  • Output of diagnosis steps 1–3 (remote failure, interactive success, klist).
  • Both Get-ADComputer check outputs for ServerC.
  • klist from ServerB before and after the purge.
  • AccountNotDelegated and Protected Users status for the user.

For the official reference, use the Microsoft Learn second-hop article. If interactive access also fails, the problem is general Kerberos. Head to the SPN and time-skew triage guide instead.

Prevention Tips

  • Script the change with a snapshot and rollback. Treat msDS-AllowedToActOnBehalfOfOtherIdentity like any other ACL change.
  • Purge before testing. Make klist purge -li 0x3e7 on ServerB a standard step after every RBCD change.
  • Put the direction in plain words. Write “ServerC trusts ServerB” in tickets. Don’t write “delegation on ServerB.”
  • Prove changes in a lab first. A spare mini PC or Intel NUC running Hyper-V with a test domain controller is enough to rehearse RBCD changes before production.
  • Audit now and then. Filter to objects that actually have the attribute set, then check each listed principal still exists and is enabled. That finds stale delegations left by retired jump servers without pulling every computer in a large directory:
Get-ADComputer -LDAPFilter '(msDS-AllowedToActOnBehalfOfOtherIdentity=*)' -Properties PrincipalsAllowedToDelegateToAccount |
    Select-Object Name, PrincipalsAllowedToDelegateToAccount
Help & Answers

Frequently Asked Questions

4 questions

Is RBCD configured on the jump server or the resource server?

On the resource server (ServerC). You set ServerC’s PrincipalsAllowedToDelegateToAccount to list ServerB.

Does RBCD require Domain Admin rights?

No. It needs permission to write the target computer object’s msDS-AllowedToActOnBehalfOfOtherIdentity attribute (or an equivalent delegated right), not Domain Admin membership.

Can RBCD work across domains or forests?

Yes. Microsoft lists this as an edge over legacy constrained delegation, which can’t cross a trust.

Why didn’t RBCD fix the error immediately?

A denial cached on ServerB can last up to 15 minutes. Purge with klist purge -li 0x3e7, wait it out, or reboot ServerB.

Wrapping Up

You can now prove a failure is the Kerberos second hop and grant ServerB delegation on ServerC’s own object. You can also clear the cached denial and roll it all back cleanly. In my view, RBCD should be the default fix for the second hop. Explicit credentials cover the WinRM-chain gap, and JEA is worth the extra setup on shared jump servers.

StepActionApplies To
1Prove the second hop (remote fails, interactive works)ServerA / ServerB
2Set-ADComputer -Identity $ServerC -PrincipalsAllowedToDelegateToAccount $ServerBServerC AD object
3Check friendly property and raw attributeManagement host
4klist purge -li 0x3e7ServerB
5Retest Get-ChildItem \\ServerC\ShareServerA via ServerB
6Roll back with $null if neededServerC AD object

Applies to Kerberos RBCD with PowerShell remoting on Windows Server 2025 (RBCD behavior consistent with Windows Server 2012+).