WMI (Windows Management Instrumentation) is often used to manage Windows systems using different graphical utilities - an implementation of the object-oriented management standard WBEM. You can use wbemtest.exe as a GUI utility for working with WMI. To work with WMI from the console created wmic.exe. We will use WMIC remotely with domain administrator credentials to scan the list of nodes (PCs / laptops) and install software without interrupting user experience. Although there are several advanced ways to accomplish this task, we will consider the simplest method: the MSI installation file, which does not require options, is located on the local disk of each remote user.
1. Load up a Command Shell with Appropriate Access PermissionsAlthough WMIC instructions can be provided with appropriate credentials before starting work, it is usually recommended to avoid clear-text typing the password(who looks over his shoulder;)). We will execute the runas command as follows:
runas /user:DomainAdminAccount@DOMAIN cmd
2. Step into WMIC Remotely to Install SoftwareOne of the nice advantages of WMIC is that it can work from any machine. With our admin shell, we're going to type wmic and then push Enter button. (Note: we could go to WMIC directly from the runas command ... it just breaks the steps).
3. Call the Installation (for a Single Machine)The main problem is that individual MSI packages will have different “options”. To simplify our example, we perform an installation with MSI, which does not require any options. We will enter the setup call as shown below. We’ll enter the install call like the following:
> /node:exampleremotemachine product call install true,"" , "c:\PathToYour\File.msi"
Execute (Win32_Product)->Install() (Y/N)?
Method execution successful.
instance of __PARAMETERS
ReturnValue = 0;
4. Call the installation (for a list of machines):We will use the WMIC feature to process the flat text file as input to the nodes to perform this installation on the list of machines (in our example, stored on the local administrator’s hard disk in C: \ computers.txt) by running the following command:
> /node::@"c:\computers.txt" product call install true,"" , "c:\PathToYour\File.msiWhich will iterate through the list in computers.txt… skipping over invalid nodes (eg: the machine is turned off), and asking for installation confirmation for each machine.
Also consider using Action1 to deploy software remotely if: