You may get below error when trying to connect with PowerShell remote.
Enter-PSSession : Connecting to remote server failed with the following error message : WinRM cannot complete the operation. verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer.
You already have firewall exception is in place for WinRM and service startup type is also set to Automatic.
This issue may happen if WinRM service is stopped on remote computer. If this is happening on high number of client computers then re-validate if firewall exceptions are in place and and Windows service type for WinRM is also set to Automatic.
Check the status of WinRM service
Get-Service -ComputerName ComputerName -ServiceName WinRm
Start WinRM service on Remote computer using PowerShell
Get-Service -ComputerName ComputerName -ServiceName Winrm | Start-Service
Start WinRM service on remote computer using SC command
You can also use SC (Service Control) command to manage services on local and remote computer.
Open command prompt on your computer and run below command
SC \\ComputerName START WINRM
- Powershell – Get System up time
- Powershell Script : List AD Organizational Unit and GPOs linked to them
- Powershell – Compare hardware and software details on two computers
- Powershell Script : Retrieve AD Computers Properties
- Powershell – Merge CSV files & Insert file name as a column
- Powershell Script: Validate if Computer account exists in Active Directory
- Powershell remote – WinRM cannot complete the operation
- Powershell script to Add bulk users / computers to AD Group
- PowerShell Script : Copy AD Group Membership
- Using PowerShell Behind a Proxy Server
Subscribe to Techuisitive Newsletter
Be the first to know about our new blog posts. Get our newsletters directly in your inbox and stay up to date about Modern Desktop Management technologies & news.