- This topic has 4 replies, 2 voices, and was last updated 3 years, 4 months ago by
August 4, 2016 at 2:53 pm #49291
I just picked up Learn Powershell Toolmaking in a month of lunches and have ran into a snag. Chapter 4 wants me to run a command:
Get-CimInstance -ClassName Win32_OperatingSystem -ComputerName
When I run this I get an error message
"PS C:\Windows\system32> Get-CimInstance -ClassName win32_operatingsystem -ComputerName sac-4175
WARNING: [WSManNetworkFailureDetected] The network connection to sac-4175 has been interrupted. Attempting to reconnect for up to 4 minutes"
I have made sure PSRemoting is turned on. The weird thing is this is a new issue. I didn't have this issue previeiously and am not sure what changed. It works fine in my VM that is running on the same domain, and even using the same image but my local desktop PC gets this error. I am not sure where to look
August 4, 2016 at 2:56 pm #49295ParticipantTopics: 0Replies: 669Points: 0Rank: Member
This message indicates that there is a network problem between your machine and the remote machine. Can you create a PowerShell remoting session to the remote machine. can you ping it? What version of PowerShell is running on the remote machine?
August 4, 2016 at 3:06 pm #49297
I can ping it, i am actually connecting to my local machine but using the computername instead of local host. Localhost works fine, computername doesn't. The response ping I get looks like its ipv6 but it does get a response
When trying to open a PSSession I get an error:
[sac-4175] Connecting to remote server sac-4175 failed with the following error message : The WinRM client received an
HTTP status code of 403 from the remote WS-Management service. For more information, see the
about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OpenError: (sac-4175:String) , PSRemotingTransportException
+ FullyQualifiedErrorId : -2144108273,PSSessionStateBroken
August 4, 2016 at 7:18 pm #49347ParticipantTopics: 0Replies: 669Points: 0Rank: Member
What happens if you do this
Get-CimInstance -ClassName Win32_OperatingSystem -ComputerName $env:COMPUTERNAME
August 4, 2016 at 9:14 pm #49356
So I got pissed off and reinstalled Windows. That seemed to fix the problem.
- The topic ‘Error when trying to run Get-CimInstance on remote machine’ is closed to new replies.