Invoke msiexec on remote machine and get 0x80070005 error
hi everyone,
i'm trying script in powershell install msi files on remote machines in same domain. when use invoke-command run simple cmdlets on remote machine works fine, when try invoke msiexec i've got error msi log
msi (c) (50:c4) [10:50:30:962]: failed connect server. error: 0x80070005
function in installfunction.ps1 file
function managemsi { param ( [parameter(mandatory=$true)] [string] $msifile, [parameter(mandatory=$true)] [msioperation] $operation, [string] $targetvdir, [string] $targetapppool = "defaultapppoll" , [string] $logpath = $msifile + ".txt" ) begin {} process { try { if($operation -eq [msioperation]::install) { start-process -filepath "$env:systemroot\system32\msiexec.exe" ` -argumentlist "/i `"$msifile`" /qn /l* `"$logpath`"" -wait } if($operation -eq [msioperation]::uninstall) { start-process -filepath "$env:systemroot\system32\msiexec.exe" ` -argumentlist "/x `"$msifile`" /qn /l* `"$logpath`"" -wait } if($operation -eq [msioperation]::installservice) { start-process -filepath "$env:systemroot\system32\msiexec.exe" ` -argumentlist "/i `"$msifile`" targetvdir=`"$targetvdir`" targetapppool=`"$targetapppool`" /qn /l* `"$logpath`"" -wait } } catch { write-error $_.exception.message.tostring() } } end {}
, code in main script
invoke-command -scriptblock { . installfunctions.ps1 managemsi -msifile $msifile -operation installservice -targetvdir $vdir } -computername $servname
function managemsi work fine on local machine.
when use
$session = new-pssession -computername $servname enter-pssession $sesion
in remote machine
msiexec /i "somesetup.msi" targetvdir="somevdir" targetapppool="defaultapppoll" /qn /l* logmsitest.txt
i've got error (sorry format above)
t h e w n d o w s n s t l l e r s e r v c e c o u l d n o t b e c c e s s e d . t h s c n o c c u r f t h e w n d o w s n s t l l e r s n o t c o r r e c t l y n s t l l e d . c o n t c t y o u r s u p p o r t p e r s o n n e l f o r s s s t n c e .
Windows Server > Windows PowerShell
Comments
Post a Comment