WMIC (Windows Management Instrumentation Command-Line) is a potent tool that often doesn’t see much use due to the lack of (easily accessible) documentation available. We’ll be using WMIC with domain admin credentials to crawl through a list of nodes (PCs/Laptops) and install software remotely without interrupting the user.
Though there are a couple advanced ways to accomplish this task, we’ll be examining the most straightforward method: an MSI installation file requiring no options located on each remote user’s local drive.
1. Load up a command shell with appropriate access permissions:- Though a WMIC instruction can be given appropriate credentials prior to operation, it is typically best-practice to avoid clear-text typing the password (who is that looking over your shoulder;)). We’ll execute the runas command like the following:
2. Step into WMIC:- One of the nice features of WMIC is that it may be run from any machine. With our admin command shell, we’re going to enter the wmic command followed by enter.
3. Call the installation (for a single machine):- WMIC’s install call allows compatible WMI applications to be installed with no interaction from the user (they see nothing, the program is simply installed according to the default installation parameters you or the product packager have specified).
4. Call the installation (for a list of machines):- We’ll use WMIC’s ability to handle a flat text file as input for the nodes to run this installation on a list of machines (in our example, stored on the admin’s local hard drive in C:\computers.txt) by running the following command:
Also consider using Action1 to install software remotely if:
- You need to perform this action on multiple (hundreds or even thousands) computers simultaneously.
- Some of your endpoints are laptops not connected to corporate network at all times.