Powershell Get-Process cannot connect to remote computer
- by amandion
I've been struggling with this for a few hours and can't figure this out. I have two Windows 7 computers. One is my workstation that is using Powershell to do administrative maintenance. The other is the machine I'd like to use Powershell remoting on to execute remote Powershell cmdlets on.
On both computers, I've enabled Powershell remoting and added all computers to TrustedHosts with the * value. On the remote computer, I've started the Remote registry service and ensured that the DCOM, Winmgmt and the Winrm services are running. Firewall is disabled on remote machine too.
The cmdlet I try to run is:
Get-Process -ComputerName $name
Where $name is the name of the remote machine. I keep getting an error saying that it could not connect to the remote PC. I've also tried using the IP and I get the same error. These PCs are not in a domain.
I am able to do the following successfully:
Invoke-Command {get-Process} -ComputerName $name -Credential $creds
Where $name is the machine name and $creds is the user name and password for the remote computer's local Admin account. This gives me the same output I would expect.
While this is an acceptable workaround, I am curious, why doesn't using get-process with remoting work as it should? I've seen a few articles on the web suggesting people have had success with it on its own.
Each time I am using Powershell on my workstation with elevated privileges.
Any ideas?