# to enable psremoting on network computers

**URL:** <https://forums.powershell.org/t/to-enable-psremoting-on-network-computers/5152>\
**Category:** PowerShell Help\
**Created:** [November 3, 2015, 1:51am UTC](https://forums.powershell.org/t/to-enable-psremoting-on-network-computers/5152 "2015-11-03T01:51:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikanth-byram](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@srikanth-byram](https://forums.powershell.org/u/srikanth-byram)\
**Post date:** [November 3, 2015, 1:51am UTC](https://forums.powershell.org/t/to-enable-psremoting-on-network-computers/5152/1 "2015-11-03T01:51:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![flynnbundy](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/flynnbundy/32/639_2.png) [@flynnbundy](https://forums.powershell.org/u/flynnbundy)\
**Post date:** [November 3, 2015, 9:23am UTC](https://forums.powershell.org/t/to-enable-psremoting-on-network-computers/5152/2 "2015-11-03T09:23:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wilfredo-perez](https://avatars.discourse-cdn.com/v4/letter/w/e99b99/32.png) [@wilfredo-perez](https://forums.powershell.org/u/wilfredo-perez)\
**Post date:** [November 4, 2015, 1:12am UTC](https://forums.powershell.org/t/to-enable-psremoting-on-network-computers/5152/3 "2015-11-04T01:12:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![srikanth-byram](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@srikanth-byram](https://forums.powershell.org/u/srikanth-byram)\
**Post date:** [November 4, 2015, 2:08am UTC](https://forums.powershell.org/t/to-enable-psremoting-on-network-computers/5152/4 "2015-11-04T02:08:13Z")

</div>

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 .

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:44pm UTC](https://forums.powershell.org/t/to-enable-psremoting-on-network-computers/5152/5 "2024-05-16T20:44:29Z")

</div>

Closed on May 16, 2024, 8:44pm UTC


