Why Can’t My Desktop Use Enter-PSSession on Some Computers?

0
15
Asked By RandomRaccoon42 On

I've been troubleshooting a weird issue with my desktop where I can't enter a PowerShell session or use Invoke-Command on a handful of computers in my network, getting "Access is Denied" errors. I ran Test-WSMan from my workstation, and that worked fine, so I ruled out some basic connectivity issues. My laptop, which has the same VPN, firewall, and AV setup, can connect just fine right next to me, so that rules out those potential problems. I even switched my desktop from ethernet to wifi thinking maybe my IP was blocked, but no luck. I've disabled every feature I could in Defender for Business, yet it still won't work. I daily connect to hundreds of computers to execute PowerShell tasks, and recently I've noticed only a few (around 8) won't connect. Any advice on what else I could check? All computers are on a Windows 11 on-prem Active Directory setup, and I'm running the commands from an elevated PowerShell window.

5 Answers

Answered By EventExplorer53 On

Have a look at the event logs on the target computers to see if there’s any indication of failed login attempts. Running commands like Get-WMIObject or Get-CimInstance might help diagnose if the issue lies deeper within permissions or network settings.

TechieToaster88 -

Good point! I've noticed some errors in the logs recently, so that might be worth investigating further.

Answered By FirewallWatcher99 On

Sometimes, the issue can arise from network configurations. A misconfigured subnet mask can lead to unexpected permission issues, so make sure nothing on that front has changed recently.

Answered By AdminAdventurer17 On

Make sure your user account has the proper rights on the remote machines. Check if you're listed in the local administrators group, and if needed, try running Enter-PSSession with your credentials explicitly specified. Also, verify that the WinRM service is running on those endpoints.

DetectiveDolphin9 -

I confirmed that my admin account is already in the local admin group, and I've specified rights access, but still no success. WinRM is okay too since my laptop connects just fine.

Answered By TechieToaster88 On

You might want to check the connection directly using Test-NetConnection with port 5985 to determine if a firewall is blocking it. That could be affecting your access to the remote systems directly.

CuriousCat81 -

I tried that test earlier and it succeeded, which makes me think it's not a firewall issue at play.

DetectiveDolphin9 -

Don't forget to check port 5986 for HTTPS as well—just to cover all bases!

Answered By NetworkNinja22 On

It might be worth confirming that PowerShell remoting is enabled via GPO. Running a gpupdate/force and checking with gpresult on the clients throwing the access denied error could shed some light on any policy issues.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.