none
powershell msiexec: unable to install the .msi package on a remote machine via jenkins

    Question

  • I am trying to install a msi package via Jenkins on a remote computer. Both the msi file and the powershell script are on the remote machine. From jenkins (which is another machine), using a powershell plugin trying to use the command

    Invoke-Command -ComputerName $env:client -ScriptBlock { param($mach,$u,$p) c:\install\scripts\Install_msi.ps1 -database $mach -username $u -password $p } -Credential $cred -Authentication CredSSP -Args $env:database,$env:username,$env:password

    This is a company created application, packaged in an msi format. The msi package has an application and also launches a dbsetup.exe which installs the databases. The purpose of the dbsetup.exe is to install databases.

    When I run the powershell script install_msi.ps1 from a powershell command window as administrator directly on the remote machine, it installs the application including the dbsetup.exe launched and installs the databases.

    The problem is when I try to do the run the same script from jenkins, it installs only the application part but doesn't run dbsetup.exe and databases aren't installed. However I can see from the task manager that dbsetup.exe is launched and status showing as running but none of the databases are installed.

    Using Powershell v4, Windows Server 2012 standard R2. Jenkins v1.612

    Jenkins server is on one domain and remote machine is on another domain.

    I am out of ideas. Any suggestions how to resolve this issue would be great.

    Thursday, October 15, 2015 11:22 AM

All replies

  • So everything works well when you run the script on the remote machine directory, and issue only happens when you "run the same script from jenkins".
     
    I don't know much about Jenkins, seems it's an open source continuous integration tool. Could you please elaborate a bit on how exactly you "run the same script from jenkins" and how Group Policy was involved in this scenario?
     
    Probably, try in a dedicated Jenkins forum for a wider pool of respondents?
     

    Regards,

    Ethan Hua


    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com

    Friday, October 16, 2015 7:23 AM
    Moderator
  • Thanks for your reply, Ethan. 

    The script works fine when run from the remote machine. The issue exists only when running from the Jenkins powershell plugin (Windows Power Shell )

    Here are the commands that I mentioned in the Jenkins' Powershell Command window:

    $pass = ConvertTo-SecureString -AsPlainText $env:password -Force
    $cred = New-Object System.Management.Automation.PSCredential -ArgumentList $env:username,$pass
    Invoke-Command -computername $env:database -scriptblock { Enable-WsManCredSSP -Role Server -Force } -Credential $cred | out-null

    Invoke-Command -ComputerName $env:database -ScriptBlock { param($user,$pwd) c:\install\scripts\Install_msi.ps1 -username $user -password $pwd } -Credential $cred  -Authentication CredSSP -Args  $env:username,$env:password


    Friday, October 16, 2015 11:23 AM
  • Thank you for your update. So Group Policy is not involved here, correct?
     
    I'm personally not farmilar with powershell commands, I'd suggest you try in our dedicated Powershell forum, where you can get more experienced responses:
     
    https://social.technet.microsoft.com/Forums/windows/en-US/home?forum=winserverpowershell
     
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
     
    Thank you for your understanding.
     

    Regards,

    Ethan Hua


    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com

    Tuesday, October 20, 2015 4:43 AM
    Moderator
  • thanks. I posted the question on the link you provided. 
    Tuesday, October 20, 2015 11:02 AM