Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Psexec in Powershell Question

$
0
0

Hello All,

To save you the long story of it all, due to circumstance, I need to run psexec through POSH to execute a command on a remote machine. My method works just fine, but I would like to know if there's a way to suppress to dos box that pops up, while psexec is running. Below is my current approach:

$command=netsh advfirewall firewall set rule group="Windows Management Instrumentation (WMI)" new enable=yes
$computer='\\nyc-byfq4m1'
$proc=gwmi -list Win32_Process    
$proc.Create("C:\windows\System32\sysinternals\psexec.exe $computer $command")

Thanks!


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>