Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell to Run a Command on a Remote Server

$
0
0

Summary: Learn how to use Windows PowerShell to run a command on a remote server.

Hey, Scripting Guy! Question How can I run a command on a remote server by using Windows PowerShell Remoting?

Hey, Scripting Guy! Answer Use the Invoke-Command cmdlet, specify the computer name, and place the command in a script block:

Invoke-Command -ComputerName server1 -ScriptBlock {hostname}


Viewing all articles
Browse latest Browse all 3333

Trending Articles



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