Remote Install Software

So, as the component owner for the Citrix Receiver, for a while I had been testing Citrix Receiver 4.9 LTSR CU2 quiet extensively.

Generally once a new version of Receiver comes out, I spend at least a week testing it in every possible version (laptop, desktop, VM, thin clients) before submitting the app for packaging. Once the packaging team is done, they hand over the installer to me for UAT. This is when I spend another week or two of testing the installer that will essentially hit thousands and thousands of computers both virtual and physical. During this time, I will pick several users and systems to pilot the package and gather feedback.

And that's where few PowerShell commands makes it a little bit easier.

There's the antique way of installing the package. Which kinda looks like this: notify user, hand over or share the package out from a shared location. Make sure user has the rights to install the software. Give user instruction on how to copy and run the program. Check back after a week to make sure if the user was able to follow instruction successfully.

With this method as you can see, we are already loosing a week of going back and forth just trying to install the darn package.

Or the other method is:

1. Notify user that they have been selected to pilot the software
2. Notify user in the event of multiple system, which one will be updated
3. Run a PS command to find out if the user already has the app you intend to install. No point reinstalling the same app. Like that never happens.




In the event if it is too small to see here's what the command is:

Invoke-command -computer Computer 1, Computer 2, Computer 3, etc. {Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*  | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate
| Where-Object {$_.publisher -eq "Citrix Systems, Inc."} | Format-Table -AutoSize }

The Invoke command basically tells each computer to return the value of all the installed software on those machines. 

The second pipeline is to weed out and select only few of the information I really care about from the returned value above.

The third pipeline is from the whole list again I really want info on certain application. In this case, it is application by Citrix such as Citrix Receiver. 

The fourth and the last pipeline is to make the whole list look more pretty. 

Now Instead of typing in computer1, computer2, etc. I could also say read the names off of a text or csv file but since here my pilot user list is relatively small, I chose to type out the name. Do keep in mind, this does increase the chance of typo. 

4. If the intended app is not installed, copy the installer over to the local drive of the system

In this case, I copied them to the local C:\Temp folder.

5. Use PSExec.exe to install the software remotely from your admin machine.

Psexec.exe \\computer1 c:\temp\Citrix\CitrixSystems_CitrixReceiver_14.9.2000.21.exe

6. Once completed, notify the user that their system has been updated and you will check back with them after a certain time to gather feedback.
7. After the certain time gather feedback.

Few things, I can already think.

1. item no. 5 instead of typing in or arrow upping several time and editing the name of the computer have a command that will install the software in iteration and return value.
2. OR simply write a whole script that will do all these items from 3 to 5 in one run taking in the name of the machines from another source. This way, I simply have to copy the machine names into the source file. The script should read off of it, execute the command. If the software I intend to installed is not on already, copy it and install it and return the success/failure value.

Thoughts?!

No comments: