Solved

Remote install of MSI file

Posted on 2016-10-17
4
35 Views
Last Modified: 2016-10-18
I have a custome logmein MSI file i want to execute remotely on a machine, is there a simple way to do this via powershell?
0
Comment
Question by:leadtheway
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
serialband earned 250 total points
ID: 41847589
I've always just used psexec to call msiexec do that.

I haven't tried through powershell, but others have written up scripts and asked for help.  Maybe those are good starting points.  https://social.technet.microsoft.com/Forums/windowsserver/en-US/297a0c86-be56-4115-bbd5-21a986695f03/powershell-remote-msi-installation?forum=winserverpowershell
https://powershell.org/forums/topic/install-software-on-multiple-remote-servers/
0
 
LVL 6

Assisted Solution

by:Niten Kumar
Niten Kumar earned 250 total points
ID: 41847818
Try using the following example:

$command =  "msiexec.exe /i C:\Avamar\AvamarClient-windows-x86_64-7.0.102-47.msi"
$scriptblock = [Scriptblock]::Create($command)
Invoke-Command -ComputerName $computer -ScriptBlock $scriptblock
0
 
LVL 6

Expert Comment

by:Niten Kumar
ID: 41847821
Also using psexec.exe example below.  Setup your user's ip addresses on clients.txt file.

cls
$computername = Get-Content 'C:\Setup\clients.txt'
$sourcefile = "C:\Setup\MySyncSvcSetup.msi"
$serviceName = "MySyncWinSvc"
$adminUserName = "username"
$adminPassword = "password@123"
#This section will install the software
foreach ($computer in $computername)
{
    #First uninstall the existing service, if any
    C:\PSTools\psexec.exe \\$computer -s -u $adminUserName -p $adminPassword msiexec.exe /x C:\SetupFiles\MySyncSvcSetup.msi /qb
    Write-Host "Uninstalling Service"
    $destinationFolder = "\\$computer\C$\SetupFiles"
    #This section will copy the $sourcefile to the $destinationfolder. If the Folder does not exist it will create it.
    if (!(Test-Path -path $destinationFolder))
    {
        New-Item $destinationFolder -Type Directory
    }
    Copy-Item -Path $sourcefile -Destination $destinationFolder
    Write-Host "Files Copied Successfully"
    C:\PSTools\psexec.exe \\$computer -s -u $adminUserName -p $adminPassword msiexec.exe /i C:\SetupFiles\MySyncSvcSetup.msi /qb /l* out.txt
    Write-Host "Installed Successfully"
    C:\PSTools\psexec.exe \\$computer -s -u $adminUserName -p $adminPassword sc.exe start $serviceName
    Write-Host "Starting the Service"
}
0
 
LVL 1

Author Comment

by:leadtheway
ID: 41848151
and i can run this on my machine?
0

Join & Write a Comment

"Migrate" an SMTP relay receive connector to a new server using info from an old server.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now