< Blog

Deploying Additional Software

By Joseph Yedid

I needed to add some additional software (Psexec, BGInfo, and cmtrace) to all of my VMs. However, adding this software manually to each new VM would be a tedious task, so instead of doing it manually I decided to automate the process! As a bonus every new VM that gets created from this point on will automatically get this additional software via a package advertised through Configuration Manager.

To begin with, I needed to create a collection of only VMs to which I will deploy the package to.

I created a query based device collection targeting only VMs.

Deploying Additional Software-Step 1

1. In the new device collection Wizard, give the collection name. Limit the collection to All Desktop and Server Clients. Click Next.

Deploying Additional Software-Step 2

2. Click Add Rule and select Query Rule.

Deploying Additional Software-Step 3

3. Give the query a name and then click Edit Query Statement…

Deploying Additional Software-Step 4

4. Click the Star button to create a new query.

Deploying Additional Software-Step 5

5. Click Select…

Deploying Additional Software-Step 6

6. Set Attribute class to System Resource and Attribute to NetBIOS Name. Click OK.

Deploying Additional Software-Step 7

7. Click OK.

Deploying Additional Software-Step 8

8. Select the Criteria tab.

Deploying Additional Software-Step 9

9. Click the Star button to add a new criteria.

Deploying Additional Software-Step 10

10. Click Select…

Deploying Additional Software-Step 11

11. Set the Attribute class to System Resource and Attribute to Virtual Machine. Click OK.

Deploying Additional Software-Step 12

12. Click on Value… and select True. Click OK.

Deploying Additional Software-Step 13

13. Click OK.

Deploying Additional Software-Step 14

14. Click OK.

Deploying Additional Software-Step 15

15. Set the schedule as you see fit. I have set my schedule to run every day to check for new VM clients. Click Next.

Deploying Additional Software-Step 16

16. Click Next.

Deploying Additional Software-Step 17

17. Click Close.

Once the collection was created, I needed to create the source folder to store the applications. In this case D:\Additional Software

Next, I needed to create a batch file which has the commands to copy my additional application software to their desired locations. The batch file will also be stored in the source folder. My batch file looks like this:

copy bginfo.exe c:\windows
copy bgconfig.bgi c:\windows
copy cmtrace.exe c:\windows
copy psexec.exe c:\windows
copy bgstartup.bat C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

Now in Configuration Manager, I created a package and program that will be deployed to the VM collection.

Once the package was created, I edited the package and specified it to contain the source files, which is the source folder.

Deploying Additional Software-Click OK

Once added, click OK.

Deploying Additional Software-Additonal Software Properties

Then I needed to edit the program and added the batch file to the command line.

Deploying Additional Software-Environment Tab

On the Environment tab, I set the program to run Whether or not a user is logged on and Run with administrative rights.

Now that that is all done, I was able to deploy the package. The batch file runs on the destination VMs and copies the files to their desired locations.

Every time a new VM is added to the collection, the package will be run and the programs will be installed. No more manual labor!