cmdlet for enable-psremoting on remote machine

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

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.

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.

thank you both Don and bob .