to enable psremoting on network computers

This topic contains 3 replies, has 3 voices, and was last updated by  Srikanth Byram 2 years, 6 months ago.

  • Author
  • #31624

    Srikanth Byram

    hi friends,

    am looking for a ps script to enable psremoting on network computers using pstools .

    below is my script

    but this didn't work as this enable only the first computer starts with hostname "pndt0001"

    $computers=Get-ADComputer -filter 'name -like "pndt000*"'|select -ExpandProperty name
    foreach ($computer in $computers)
    {C:\PSTools\PsExec.exe \\$computer -s powershell Enable-PSRemoting -force}

    am looking for script which first should test the connections to listed computers and then pass tested connection machines to execute the command by filtering not connected machines.


  • #31638

    Flynn Bundy

    Hi Srikanth,

    Going to ask a bit of an obvious question here.

    Why not use Group Policy to enable PSRemoting?
    Chances are this day and age if you hear to word 'Psexec' its probably not the best way to do it.

  • #31652

    Wilfredo Perez

    I agree with Flynn, GPO is the way to go.

  • #31659

    Srikanth Byram

    hi Flynn,

    i was aware of this option doing via GPO but we have very limit scope on AD given to us (i hope that you got my point now) .

    we have around 300 machines in our organisation after researching for days i found this option of doing via Psexec and can able to do it for single machine at one time .

    i need a script for enabling psremoting for multiple machine at one time .

You must be logged in to reply to this topic.