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

Popular posts from this blog

Error: 0x80073701 when trying to add Print Services Role in Windows 2012 Standard

Disconnecting from a Windows Server 2012 R2 file sharing session on a Windows 7,8,10 machine

Windows 2016 RDS event 1306 Connection Broker Client failed to redirect the user... Error: NULL