to enable psremoting on network computers

Welcome Forums General PowerShell Q&A to enable psremoting on network computers

This topic contains 3 replies, has 3 voices, and was last updated by

 
Participant
3 years, 2 months ago.

  • Author
    Posts
  • #31624

    Participant
    Points: 0
    Rank: Member

    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.

    thanks

  • #31638

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

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

  • #31659

    Participant
    Points: 0
    Rank: Member

    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 .

The topic ‘to enable psremoting on network computers’ is closed to new replies.