There are two types of sysadmins: Those who prefer a graphical user interface (GUI) and those that have been sysadmins long enough to know better. Don’t get me wrong; a good GUI can go a long way. But with the right commands at your disposal, there’s not much you can’t do or fix. Today, we’ll take our commands to the next level by showing a few different ways to run remote commands on your managed devices.
Running remote commands the old-fashioned way
Running commands on remote computers is nothing new. Sysadmins have been tampering with supporting remote devices since before Ferris Bueller missed a day of school. But the process has changed over the years. For many, PsExec — the ever-popular Sysinternals utility — was a mandatory part of their sysadmin toolkit, allowing them to run commands and execute programs remotely.
More recently, PowerShell has made it easier than ever to run commands on remote devices. Using WinRM, sysadmins can leverage cmdlets like Invoke-Command, which is great for running single commands, and New-PSSession, which can create persistent connections to multiple remote targets simultaneously.
But… what if I told you it can get even easier to run remote commands?
Don’t let the complexity of running remote commands bumfuzzle you. Let PDQ Deploy & Inventory drastically simplify the process. Worried about your off-prem devices? Don’t be. PDQ Connect ensures any computer with an internet connection is just a few clicks away. Try them out for yourself and discover what simplified IT management looks like.
How to run remote commands with PDQ Inventory
PDQ Inventory makes it super easy to run remote commands. With all the necessary functionality baked right into the Inventory console, you’ll be firing off remote commands faster than your users can click on malicious links. Here’s how the process works.
In PDQ Inventory, select a computer (or multiple computers).
Right-click on the selection, then click Tools, then click Run Command.
Enter your command into the command line, then hit the Execute button.
When your command finishes executing, the run command window displays the output from the remote device(s).
There are a few other things I should point out in this window. Next to the command line, there is a drop-down option to change to a PowerShell prompt. You can also select the Multi-line option to add commands that are more than just one-liners. You can configure different settings by clicking the Options drop-down menu, such as the run as mode, the timeout settings, success codes, and more. Lastly, you can add more targets by right-clicking in the computers field in the bottom left of the window, then clicking Choose Computers.
Once you get comfortable running commands from PDQ Inventory, take things to the next level by building your own custom tools in PDQ Inventory.
How to deploy commands and scripts to remote devices with PDQ Deploy
PDQ Deploy is well known for simplifying application and patch deployments. But did you know that Deploy also makes sending out commands and scripts to on-prem devices easier than sleeping through your alarm on a Monday morning? Here’s how easy it is to distribute commands and scripts using PDQ Deploy.
In PDQ Deploy, click the New Package button.
Enter a name for the package, then click New Step > Command or New Step > PowerShell. In this example, I’ll use a PowerShell step.
If you have a script already, you can click the Insert PowerShell Script link; otherwise, just enter the command into the PowerShell window.
Click Save when finished, and close the package editor window.
With the package saved, your command or script is ready to deploy to your devices whenever needed. When you’re ready, here’s how to deploy the package to your devices.
Select the package, then click Deploy Once.
Enter the names of your target computers, then click Add Computer.
With your targets added, click Deploy Now.
That’s it. That’s the entire process. You can add as many or as few devices as you want to a deployment. You can also target collections in PDQ Inventory to ensure you’re deploying to the correct computers.
How to run commands on remote endpoints using PDQ Connect
The ability to run commands on remote endpoints is a necessity for IT departments these days, especially since the great work-from-home migration of 2020. But what about those truly hard-to-reach devices? You know, the ones whose users have never even heard of a VPN? Don’t worry; we’ve got you, fam. PDQ Connect easily deploys commands, scripts, and packages to any Windows computer with an internet connection. Here’s how to run a command against a remote computer with Connect.
In PDQ Connect, click the Packages tab.
Click Create package.
Name the package.
Click the drop-down arrow next to Add install step, then click Add script step.
Set the script type (either PowerShell or CMD). I’ll use a CMD command for this example.
Click the Import link to import a script, or type your command into the scripting pane.
When finished, click Save to save your package.
With your package saved, it’s ready to deploy to all those users working in Timbuktu — or Cleveland. Simply select the package you just created (it’ll be located in the Packages tab), then click Deploy. Add your devices or groups to the deployment, then click Deploy.
Within minutes (more likely, seconds), your deployment speed surfs its way across the web to the targeted devices. Congrats, your remote commands have officially gone global. Next stop, deploying commands to space? One day…