cmdlet for enable-psremoting on remote machine

This topic contains 3 replies, has 3 voices, and was last updated by Profile photo of Srikanth Byram Srikanth Byram 1 year, 1 month ago.

  • Author
  • #29080
    Profile photo of Srikanth Byram
    Srikanth Byram

    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

  • #29081
    Profile photo of Don Jones
    Don Jones

    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.

  • #29083
    Profile photo of Bob McCoy
    Bob McCoy

    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.

  • #29117
    Profile photo of Srikanth Byram
    Srikanth Byram

    thank you both Don and bob .

You must be logged in to reply to this topic.