Here is what I want to do – I would like to install a software on every PC in my domain. I would like it fully automated. I am sure this can be done either using a batch file or a vbscript. Here is what I would like to do:
- Check if file exists on local machine based on log file (related to step 4)
- If not, copy exe from server location e.g. \servername\c$\Temp to C:\Temp
- Run the installation (the app needs to be installed using cmd prompt so this step will most probably be a batch file)
- Log the results to a log file (.txt) on the server so that the script knows which PC has been completed.
I am completely new to scripting so can someone point me in the right direction? Many thanks in advance.
Best Answer
First you need to determine whether the install can be run from the command line, and what switches are available/mandatory. If the installer is (or includes) a .msi, this is most likely the case.
PSExec is a tool by SysInternals (purchased by Microsoft, but kept under the SysInternals name - just search for it) that I use to do this kind of thing all the time. Create a file (I usually use "targets.list") that consists of all of the target systems, one per line. Place it in a directory with PSExec and your installer. Run "
psexec @targets.list -c [filename] [arguments]
".The logging isn't great, but you can find plenty of scripts to list out computers' Installed apps. I often start at the Microsoft Script Center Repository. (This is probably easily accomplished in Powershell.) (One example is this script: "List All Installed Software".) Modify the script so that it only reports on the app you care about, or only lists machines that don't have it... I'd also set it up to also use the same "targets.list" file. There's more than one way to do it!
-Waldo