---
title: "How to Fix PowerShell’s Double-Hop Problem: A Complete Guide"
description: "Learn how to overcome PowerShell's double-hop authentication limitation with session configurations. This guide shows you practical solutions for remote access problems."
canonical: "https://adamtheautomator.com/powershell-double-hop-fix/"
---

# How to Fix PowerShell’s Double-Hop Problem: A Complete Guide

> Learn how to overcome PowerShell's double-hop authentication limitation with session configurations. This guide shows you practical solutions for remote access problems.

Source: https://adamtheautomator.com/powershell-double-hop-fix/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![How to Fix PowerShell’s Double-Hop Problem: A Complete Guide](https://adamtheautomator.com/wp-content/uploads/2025/01/featured-image.webp)

# How to Fix PowerShell’s Double-Hop Problem: A Complete Guide

[![](https://secure.gravatar.com/avatar/d0b9d42e21e5622713f8b693aa5c0f9244d5f7dd200ed29b8398f52dee5de337?s=192&d=mm&r=g)Adam Bertram](https://adamtheautomator.com/author/adam-bertram/)8 January 20253 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[PowerShell](/tag/powershell/)

Table of Contents

*   [Running PowerShell as a Different User](#running-powershell-as-a-different-user)
*   [Testing Remote Connections](#testing-remote-connections)
*   [Solving the Double-Hop Problem with Session Configurations](#solving-the-double-hop-problem-with-session-configurations)
*   [Conclusion](#conclusion)

Have you ever tried accessing a remote resource within a PowerShell Remoting session only to hit a frustrating access denied roadblock? This common issue, known as the “double-hop” problem, prevents you from accessing a second remote machine from your current session.

The good news? There are ways to solve the double-hop problem without overly complex configurations. In this tutorial, you’ll build a customized session that seamlessly handles authentication, saving you time and effort while maintaining security.

Overcome double-hops with session configurations and streamline your workflow!

If double-hop troubleshooting keeps showing up in your environment, compare [Udemy technical training courses for cloud, development, security, and business software skills](https://trk.udemy.com/c/1454808/3193860/39854) before choosing a paid course library. Training with Windows authentication, PowerShell remoting, and identity administration labs is a better fit than generic scripting content.

## Running PowerShell as a Different User

If you’re working with scripts that connect to remote resources, you might encounter the double-hop problem. This issue occurs when your credentials fail to authenticate beyond the first hop in a remote connection.

For example, consider a script that counts sub-directories on a remote computer using a UNC path:

```
(Get-ChildItem -Path \\SRV2\c$ -Directory).Count
```

If you’re logged in to a user that lacks permission to access a resource, you can run PowerShell under a different user account:

1.  Search for PowerShell in the Start menu.
2.  Right click the PowerShell shortcut and select **Open file location**.
3.  In File Explorer, hold Shift, right-click the shortcut, and select **Run as different user**.
4.  Enter the credentials of a user with the necessary permissions.

After starting PowerShell as a different user, the command should now succeed:

```
(Get-ChildItem -Path \\SRV2\c$ -Directory).Count
```

* * *

**__Tip**:** If you frequently run commands with different credentials, consider using the `Start-Process` cmdlet with the `-Credential` parameter. This approach allows you to open new PowerShell sessions directly from the console with alternate credentials.__**

* * *

## Testing Remote Connections

You might successfully access a remote resource locally, like a shared folder, when working with multiple remote systems. But you then discovered that the same command produces an “access denied” error when executed (from a second remote computer).

This inconsistency can be confusing, especially when you’re confident that your credentials have sufficient permissions.

To test your remote connections, establish a session with another computer:

```powershell
Enter-PSSession -ComputerName SRV3
```

Once connected, try running the same command on the second machine:

```
(Get-ChildItem -Path \\SRV2\c$ -Directory).Count
```

This test often results in an “access denied” error, even if you use an account with permissions.

Confirm your current user with the following:

```bash
whoami
```

This behavior (double-hop) happens because PowerShell doesn’t pass your credentials to the next hop. This mechanism is a security feature built into Kerberos authentication, but it can be a major headache when managing multiple systems.

## Solving the Double-Hop Problem with Session Configurations

One solution to the double-hop problem is to create a session configuration on the intermediate machine.

Start by registering a session configuration on the computer you’re connecting to, in this case, SRV3.

The following command:

*   Assigns a `Name` to the session configuration (e.g., `Admin`).
*   Specifies the account (**`RunAsCredential`**) sessions will run under.
*   Ensures (**`Force`**) the configuration is applied and restarts the WinRM service.

```powershell
Invoke-Command -ComputerName SRV3 -ScriptBlock {
    Register-PSSessionConfiguration -Name Admin -RunAsCredential 'psforsysadmins.local\adam' -Force
}
```

PowerShell prompts you for the password for the `RunAsCredential` account, which is stored securely on the remote machine. Once the configuration is registered, the WinRM service restarts and the session is closed.

With the configuration in place, you can now connect using the `ConfigurationName` parameter:

```powershell
Invoke-Command -ComputerName SRV3 -ScriptBlock {
    (Get-ChildItem -Path \\SRV2\c$ -Directory).Count
} -ConfigurationName Admin
```

This command performs the same operation as before. However, it specifies the `Admin` session configuration, which runs under the specified admin account.

* * *

**__Tip: Limit access to the session configuration by defining user or group-specific access permissions using the `Set-PSSessionConfiguration` cmdlet. Doing so ensures that only authorized users can leverage the configuration.__**

* * *

## Conclusion

In this guide, you’ve seen and resolved the double-hop problem in PowerShell Remoting. Setting up a session configuration can resolve the double-hop problem and ensure that credentials are passed securely.

This solution is persistent, so you can reuse the configuration even after reboots, making it a robust approach to managing remote PowerShell sessions. Now, you can manage multi-hop remote operations confidently and streamline workflows without compromising security.

From here, consider exploring advanced security options, such as restricting session access or implementing certificate-based authentication. These enhancements can further strengthen your remoting setup while managing complex environments flexibly.

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-double-hop-fix%2F&text=How%20to%20Fix%20PowerShell%E2%80%99s%20Double-Hop%20Problem%3A%20A%20Complete%20Guide)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-double-hop-fix%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-double-hop-fix%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2026/06/26995-troubleshoot-dns-issues-powershell-codex.webp)

### [Troubleshoot DNS Issues with PowerShell](/troubleshoot-dns-issues-powershell/)

Troubleshoot DNS issues with PowerShell by testing name resolution, DNS client settings, cache entries, and network connectivity in a repeatable workflow.

![](https://adamtheautomator.com/wp-content/uploads/2025/10/image_2025-10-24_095322075.png)

### [Migrating from PowerShell 6 to 7.5: Breaking Changes/New Features](/migrating-powershell-6-to-7-5/)

Migrate from PowerShell Core 6 to 7.5: breaking changes, features, and testing tips.

![](https://adamtheautomator.com/wp-content/uploads/2025/06/featured-image-6.png)

### [How to Add Timeouts to Pester Tests with PowerShell Runspaces](/pester-test-timeout-runspaces/)

Prevent Pester tests from hanging indefinitely using PowerShell runspaces. Learn to handle variable scoping, module loading, TestDrive access, and stream capture challenges with timeout protection.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
