Disclaimer
This is my personal blog. The opinions and views I express are my own. The information I provide is on an as-is basis. I make no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this blog and will not be liable for any errors, omissions, or delays in this information or any losses, injuries or damages arising from its use.

Remotely Install Adobe Reader with PowerShell

This scripts is quick, dirty and could be made more efficient. That said, it works.Reads a

As constructed it reads a txt file containing computer names and attempts to ping each machine. If the ping is successful, it copies the contents of c:\Install from the source computer to c:\install on the target machine. Once the copy is complete it tests that the install package is present in the correct directory on the target (in my case the Adobe Reader DC offline installer). Once the file is confirmed on the target it launches the installation silently with no reboot or user interaction required.

The exact syntax for the Adobe Reader installation silently and without user interaction or a reboot I retrieved here.

This example uses the Adobe Reader install package but it can easily be modified
to install other software packages.

<#
	** THIS SCRIPT IS PROVIDED WITHOUT WARRANTY, USE AT YOUR OWN RISK **	

    .SYNOPSIS
	    Copy an install package to 1 or more computers and install silently

	.DESCRIPTION
	    Reads a txt file containing computer names and attempts to ping each machine
        If the ping is successful, Copy the contents of c:\Install from the source computer 
        to c:\install on the target machine. Once the copy is complete test that the install
        package is present (in my case the Adobe Reader DC offline installer) and then launch
        the installation silently with no reboot or user interaction required.

        This example uses the Adobe Reader install package but it can easily be modified
        to install other software packages.

    .REQUIREMENTS
        1. The appropriate rights to ping and copy on the remote machine.
		2. A computers.txt file with a list of computer names
        3. PowerShell remoting enabled if the target is a client OS
        4. Appropriate permissions on the target machine to install software

    .NOTES
        Tested with Windows 10 source and Windows Server 2K12 R2 target

	.AUTHOR
		David Hall | https://www.signalwarrant.com/

	.LINK
		
        Adobe reader DC download: http://ardownload.adobe.com/pub/adobe/reader/win/AcrobatDC/1501020060/AcroRdrDC1501020060_en_US.exe
        
#>

# This is the file that contains the list of computers you want 
# to copy the folder and files to. Change this path IAW your folder structure.
$computers = Get-Content "C:\scripts\computers.txt"

# This is the directory you want to copy to the computer (IE. c:\folder_to_be_copied)
$source = "c:\install"

# On the desination computer, where do you want the folder to be copied?
$dest = "c$"

$testPath = "c:\install\AcroRdrDC1501020060_en_US.exe"

foreach ($computer in $computers) {
    if (test-Connection -Cn $computer -quiet) {
        Copy-Item $source -Destination \\$computer\$dest -Recurse -Force

        if (Test-Path -Path $testPath) {
            Invoke-Command -ComputerName $computer -ScriptBlock {powershell.exe c:\Install\AcroRdrDC1501020060_en_US.exe /sAll /msi /norestart ALLUSERS=1 EULA_ACCEPT=YES}
            Write-Host -ForegroundColor Green "Installation successful on $computer"
        }

    } else {
        Write-Host -ForegroundColor Red "$computer is not online, Install failed"
    }

}

 

10 Comments

  1. Tony M | | Reply

    the $computers (i put them in the text file) shows up not online, install failed. The computers are online. What am I missing?

  2. Rick | | Reply

    I’m having the same problem as Emily and Peter…it copies to remote computer but does not install software.

    • project640 | | Reply

      check WinRM (windows remote management )service on the host machine

  3. Frank Black | | Reply

    Worked great for me. Used it to install a Cisco AMP client and (after a few flag changes) it worked without a hitch. Thank you for sharing, love your YouTube channel and hope you post more. Cheers!

  4. peter | | Reply

    Copies to remote system but doesn’t install software.

    • Rick | | Reply

      Did you ever figure out how to get it to install?

  5. Emily | | Reply

    Also doesn’t Write-Host if the computer is not online.

  6. Emily | | Reply

    Copies to remote system but doesn’t install software.

    • Rick | | Reply

      Did you ever figure out how to get it to install?

Leave a Reply to Frank Black Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.