power shell command to for "enable-psremoting -force" on a remote machine


  • hi,

    i want to use the "enable-psremoting -force" via powershell on a remote machine.

    I've tried with the following

    Invoke-command -ComputerName $compName -Credential $compCred -ScriptBlock {enable-psremoting -force}

    but that doesnt work.

    is that generally possible? Which cmdlet is needed?


    Thursday, June 21, 2012 2:15 PM


  • That can't work, because Invoke-Command requires PSRemoting in the first place.  You will have to run this command (with elevated priveliges) locally on the target machine.

    Grant Ward, a.k.a. Bigteddy

    Thursday, June 21, 2012 2:32 PM