Author Posts

August 27, 2015 at 2:31 pm

invoke-command winrm -cn computername -scriptblock {enable-psremoting}

above command gives error

error : client cannot connect to the destination specified

note :winrm service is running on the destination specified.

am using powershell v3

August 27, 2015 at 2:33 pm

You can't use Remoting to enable Remoting. If Remoting isn't turned on on the remote machine, Invoke-Command can't connect to it.

You need to run Enable-PSRemoting locally, or use GPOs to enable it. See, "Secrets of PowerShell Remoting" for extremely detailed walkthrough.

August 27, 2015 at 8:19 pm

I agree with Don — these should really be done via GPO. But if that is not an option, I've written a brief How-To using PSExec.

August 28, 2015 at 12:37 pm

thank you both Don and bob .