BDC Hamburger Icon

Menu

Close
BDC Logo
Search Icon
Advertising Disclosure
Close
Advertising Disclosure

Business.com aims to help business owners make informed decisions to support and grow their companies. We research and recommend products and services suitable for various business types, investing thousands of hours each year in this process.

As a business, we need to generate revenue to sustain our content. We have financial relationships with some companies we cover, earning commissions when readers purchase from our partners or share information about their needs. These relationships do not dictate our advice and recommendations. Our editorial team independently evaluates and recommends products and services based on their research and expertise. Learn more about our process and partners here.

How to Remotely Invoke Applications With PowerShell

PowerShell offers several ways to invoke applications on remote computers.

author image
Written by: Adam Bertram, Senior WriterUpdated Jan 02, 2025
Gretchen Grunburg,Senior Editor
Business.com earns commissions from some listed providers. Editorial Guidelines.
Table Of Contents Icon

Table of Contents

Open row

Have you ever been given an application and instructed to run it on various computers and systems, only to realize that it wasn’t built for multiple hosts? After all, some apps are designed to be executed only locally. While this problem can be perplexing, many IT professionals understand that they can run an app like this with various deployment tools. These tools copy the app to the necessary computers and execute it. Although this method can solve the problem, it can be overkill.

Fortunately, Microsoft PowerShell provides several ways to invoke applications on remote computers — giving you a quick way to copy the app to a few machines and get it running.

How to remotely invoke applications with PowerShell

PowerShell offers various ways to execute applications on remote computers. Two methods use Windows Management Instrumentation (WMI), and a third process uses PowerShell remoting, the preferred method.

“PowerShell remoting lets you manage multiple machines from one console, making your work much more efficient,” said Ismail Durgut, an experienced freelance programmer. “You can run scripts and commands on remote systems, which streamlines tasks and cuts down the need for physical access. Plus, it keeps your systems secure by using encrypted communication channels.”

Create() method

The Win32_Process WMI class is one way to run a process on a remote computer. Similar to how you might use PowerShell to manage IIS (a way to host websites on remote computers), you can use PowerShell to run programs on other computers.

Win32_Process is a WMI class with a static method called Create(). This method allows you to pass an EXE to it and run it on the remote computer using the WMICLASS-type accelerator.

WMICLASS is a shortcut to enable access to all of the class’s static properties and methods. Because Create() is a static method, you don’t actually have to initiate a Win32_Process object at all. You can simply call the method with the EXE as the first argument, and it will run.

([WMICLASS]”\MEMBERSRV1\root\cimv2:Win32_Process”).create(“notepad.exe”)

In this instance, you’re running the Notepad.exe process on the computer MEMBERSRV1. However, this process is not interactive, so you won’t see Notepad.exe pop up on a logged-in console. Remote process execution is best for applications that don’t require interactive input.

“The WMI Create() method works well for creating new instances of WMI classes, but it can feel limited for more complex tasks,” offered Durgut. “Invoke-WmiMethod gives you a more flexible and user-friendly way to execute methods on WMI objects. It also handles errors better, which makes your work easier.”

Did You Know?Did you know
The WMICLASS-type accelerator makes running EXEs on remote computers more streamlined and less prone to error.

Invoke-WmiMethod cmdlet

You can also use the Invoke-WmiMethod cmdlet, which is a less complicated process and a more user-friendly way to call static methods such as Create().

Invoke-WmiMethod –ComputerName MEMBERSRV1 -Class win32_process -Name create -ArgumentList “notepad”

This accomplishes the same goal. However, you’re expressing the Win32_Process class and the parameter to Create() — the EXE itself — slightly differently.

FYIDid you know
The Invoke-WmiMethod cmdlet makes remote application invocation more manageable, which is helpful for more complex operations.

PowerShell remoting

PowerShell remoting will likely be your preferred option for remotely invoking applications. The previous two methods using WMI depended on remote DCOM being enabled on the computer. This may or may not be a problem, but it can sometimes pose a security risk.

“WMI methods feel clunky compared to modern PowerShell remoting,” said web developer Vincent Schmalbach. “While Create() and Invoke-WmiMethod both work, they’re basically legacy tools at this point. Invoke-WmiMethod is slightly easier to use since it has PowerShell-style syntax, but both are slower and more limited than just using Enter-PSSession.”

You can use PowerShell remoting through the Invoke-Command cmdlet to kick off a process on a remote computer. (You can also use WSMan, a newer, more secure protocol.)

To do this, use a combination of two cmdlets: Invoke-Command to enable you to run a command on the remote computer and Start-Process to execute the process.

Invoke-Command –ComputerName MEMBERSRV1 –ScriptBlock {Start-Process notepad.exe}

Did You Know?Did you know
The Invoke-Command cmdlet does more than remotely launch applications. This versatile scripting tool can also enable you to remotely sync commands with PowerShell.

Invoke-Command is a PowerShell cmdlet that allows you to execute code on a remote computer as if it were local. This process has a script block parameter to insert any code to run locally on that remote computer. In this instance, you’re using Start-Process, which runs a specific application.

Durgut shared with business.com his steps for setting up PowerShell remoting securely and effectively: “Start by enabling remoting with Enable-PSRemoting. Next, configure trusted hosts using Set-Item, set up authentication — either Kerberos or certificate-based — and make sure your connections are secure and encrypted, ideally using HTTPS. These steps help you stay secure while taking full advantage of remote administration.”

PowerShell provides numerous ways to invoke processes on remote computers. Start with Invoke-Command/Start-Process to see if that method gives you the results you need. If not, you might need to look into the older methods of using WMI. At least one of these methods will get that process running remotely.

TipBottom line
If the Invoke-Command/Start-Process doesn’t produce the desired results, revert to the WMI method.

The benefits of using PowerShell to access applications

Using PowerShell to invoke applications on remote computers has four primary benefits:

  • Saves administrators time and resources: Administrators can execute operations on remote computers without being there in person. This saves time and reduces the need for on-site support.
  • Helps you solve problems: Invoking applications remotely means you can resolve problems wherever you are and make any necessary changes to specific applications.
  • Makes updates easier: Using PowerShell to access applications makes distributing software and updates simpler, faster and more efficient. Many larger companies use this approach to save time. “PowerShell scripts help you automate repetitive tasks, which reduces human error and saves you time,” Durgut explained. “When it comes to software distribution, PowerShell can deploy applications to multiple systems at once, ensuring everything stays consistent and efficient. Plus, its strong scripting features let you add detailed logging and error handling to make troubleshooting easier.”
  • Simplifies software deployment: “Instead of clicking through installers on each machine, you can write a single script that handles everything — downloading installers, checking prerequisites, running installations silently and verifying everything worked correctly,” according to Schmalbach.

Schmalbach warned coders about the challenges posed by GUI applications and session isolation to remote application execution. “Running graphical programs remotely often fails because of session 0 isolation,” he advised. “The solution is to either stick to command-line tools or use PowerShell to trigger scheduled tasks that run in the user’s session. Also, build retry logic into your scripts — network hiccups happen, and your scripts should handle them gracefully.”

Durgut added, “You might run into problems with network configurations, firewall settings or permissions when running remote applications. To avoid these issues, make sure your network is set up correctly, configure firewalls to allow PowerShell remoting traffic and check that user accounts have the right permissions. Regular updates and patches can also help prevent compatibility problems.”

If you want to enhance your PowerShell capabilities further, consider learning about and experimenting with PowerShell modules next so you can organize and share your code more efficiently. Alternatively, learn about managing files over SFTP with PowerShell to seamlessly handle file transfers between remote systems.

Mark Fairlie contributed to this article.

Did you find this content helpful?
Verified CheckThank you for your feedback!
author image
Written by: Adam Bertram, Senior Writer
Adam Bertram is an IT expert and business owner who has spent decades advising on network administration and security, designing and building infrastructure, and creating and teaching courses on Windows Server, Powershell and more. While maintaining his own IT business, he has provided hands-on DevsOps services for clients like JPMorgan Chase. At business.com, Adam covers the ins and outs of PowerShell, helping companies improve their Windows configurations and automations. Bertram, who has a degree in computer science, holds Microsoft, Cisco and CompTIA credentials. He has written numerous tutorials, guides and books, including "Building Better PowerShell Code: Applying Proven Practices One Tip at a Time."
BDC Logo

Get Weekly 5-Minute Business Advice

B. newsletter is your digest of bite-sized news, thought & brand leadership, and entertainment. All in one email.

Back to top