It has also been tested with many different versions of the below software. I would like to exapand this list, so please submit other VNC flavors and I’ll see if I can add it. This script has been tested to work with the VNC flavors listed below. It may not work very well if VNC was installed manually (like via. It’ll work really well if VNC was installed using the installers and default options were chosen. The script doesn’t really check if VNC is installed, it simply deletes a bunch of default VNC folders, files, registry keys, and services. I needed a way to get a computer to a clean slate before deploying an upgraded VNC Server.
To do this, I first need to wrap the command I need to run in a scriptblock.The following script was written to silently remove VNC Servers and VNC Viewers from a computer.
I'll use the Invoke-Command to remotely execute the silent install from my computer. PowerShell remoting is an excellent way to make this happen. Next, I need to invoke the install remotely. $ClientName = 'MYCLIENT'Ĭopy-Item –Path $InstallerFolder –Destination \\$ClientName\c$ -Recurse To do this, I Copy-Item to do a simple file copy of the entire VNC folder. Next, I need to copy the setup.exe and the INF file to remote computers on demand. $InstallerFolder = '\\MEMBERSRV1\ToolShare\VNC' I'll put them on a share called ToolShare on my MEMBERSRV1 server.
We’ll learn how to make these files accessible to every computer, deliver those bits to a remote computer, and execute the install remotely.īecause we'll probably need to reference the installer bits over and over again, it's a good idea to place them on a file share somewhere on the network. Since we already have everything necessary to perform the install locally, now we need to first figure out where we're going to store the setup.exe file and the INF file. Let's automate all of this with a PowerShell function. The way it is now, we’d have to manually copy the setup.exe and the INF file to remote computers. However, we have no way to do this to remote computers.
Great! We now have the ability to silently install this software on a machine. When executed, this syntax will silently install UltraVNC with all the same answers I initially provided, which are manually saved in the INF file. Setup.exe /verysilent /loadinf="C:\silentinstall.inf" To do that, I need to add another switch to this: /verysilent. This works, but doesn't make the install completely silent like I need it to be. Setup.exe /loadinf="C:\silentinstall.inf" This is possible using the /loadinf switch and passing the file name in the same manner. Next, I need to figure out how to use this answer file when installing UltraVNC on another computer.
This will save a file called silentinstall.inf to the root of my C drive. Setup.exe /saveinf="C:\silentinstall.inf" While browsing in Itninja's software library, I discovered that I needed to first perform a single install and save all the answers I provided to in an INF file with the /saveinf switch. Depending on the software, this might be either an easy experience or an incredibly frustrating one.
In this article, I'll show you how to build a PowerShell script that allows you to remotely install UltraVNC on as many computers as you need.īefore we get too far, however, we first need to figure out the switches required to make the install silent. However, this takes time and resources, so it's much better to automate this process and directly send the installation files remotely, with no user interaction at all. At that point, you might have talked the user through installing VNC on the server from a file share somewhere on the network. If you're a desktop administrator, I'm sure there's been a time whenever you needed to VNC to a user's desktop, only to find that VNC was not installed yet.