Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 远程MSI安装成功,但经过审核后,无法向其他应用注册_Powershell_Windows Installer_Remote Access - Fatal编程技术网

Powershell 远程MSI安装成功,但经过审核后,无法向其他应用注册

Powershell 远程MSI安装成功,但经过审核后,无法向其他应用注册,powershell,windows-installer,remote-access,Powershell,Windows Installer,Remote Access,我有一个PowerShell脚本来安装我已成功创建的MSI,它在计算机上运行时工作。 然后,我使用invoke命令和enter-pssession在脚本块内运行脚本,两种方法都成功,但它不会将软件注册到它使用的主程序中(configuration.xml文件应该更新,但不会更新)。当我们使用UAC时,所有PowerShell和命令行会话都以提升的网络管理信誉运行。 安装文件包含一个注册工具(exe),我可以从PowerShell和命令行本地成功运行(使用代码),并更新configuration.

我有一个PowerShell脚本来安装我已成功创建的MSI,它在计算机上运行时工作。 然后,我使用invoke命令和enter-pssession在脚本块内运行脚本,两种方法都成功,但它不会将软件注册到它使用的主程序中(configuration.xml文件应该更新,但不会更新)。当我们使用UAC时,所有PowerShell和命令行会话都以提升的网络管理信誉运行。 安装文件包含一个注册工具(exe),我可以从PowerShell和命令行本地成功运行(使用代码),并更新configuration.xml。 一旦我远程运行注册工具(invoke命令,输入pssession,psexec),它就会运行,不会返回错误,但它不工作(不更新configuration.xml)

我已经记录了安装,没有问题,甚至每次查看器都会显示成功安装

在远程会话中运行可能会干扰注册,并且无法理解

这里有一些更多的信息,以更好地显示我所做的

软件安装=程序安装
软件寄存器=ClientSettings.xml文件已更新

MSI安装代码:

Start-Process msiexec.exe -Wait -PassThru -ArgumentList '/I "C:\Installs\SOFTWARE\Files\SOFTWARE.msi" ALLUSERS="1" COUNTRY=OP ALLOWWEBUPDATES=0 ALLOWREMOTESERVICES=0 STANDALONE=No INSTALLCOUNSELING=No ADDLOCAL=Media,Common,Algorithm,ProgramFiles,CompactSQL2005,FlexNetConnect,FusePlatform,LanguageIndependent,RatataskPlatform,SpecSaversOnly /quiet'
#(software installs, software registers)
远程运行上述操作:

invoke-command -computername MYPC -scriptblock {Start-Process msiexec.exe -Wait -PassThru -ArgumentList '/I "C:\Installs\SOFTWARE\Files\SOFTWARE.msi" ALLUSERS="1" COUNTRY=OP ALLOWWEBUPDATES=0 ALLOWREMOTESERVICES=0 STANDALONE=No INSTALLCOUNSELING=No ADDLOCAL=Media,Common,Algorithm,ProgramFiles,CompactSQL2005,FlexNetConnect,FusePlatform,LanguageIndependent,RatataskPlatform,SpecSaversOnly /quiet' }
#(software installs, software does not register) I found the failure is the registration.exe tool
invoke-command -computername MYPC -scriptblock {start-process -NoNewWindow -FilePath 'C:\Installs\Software\Files\program files\Software\Noah4RegistrationTool.exe' -ArgumentList '/R /P "C:\Program Files (x86)\Software\Software.exe" /L "C:\Program Files (x86)\Software\Software\Logo.dll" /I 3 /M 35 /N "Software 1.5"'}
#(software doesn't register) No errors are produced and event viewer shows no errors
在本地运行注册工具:

start-process -NoNewWindow -FilePath 'C:\Installs\Software\Files\program files\Software\Noah4RegistrationTool.exe' -ArgumentList '/R /P "C:\Program Files (x86)\Software\Software.exe" /L "C:\Program Files (x86)\Software\Software\Logo.dll" /I 3 /M 35 /N "Software 1.5"'
#(software registers)
远程运行注册工具:

invoke-command -computername MYPC -scriptblock {Start-Process msiexec.exe -Wait -PassThru -ArgumentList '/I "C:\Installs\SOFTWARE\Files\SOFTWARE.msi" ALLUSERS="1" COUNTRY=OP ALLOWWEBUPDATES=0 ALLOWREMOTESERVICES=0 STANDALONE=No INSTALLCOUNSELING=No ADDLOCAL=Media,Common,Algorithm,ProgramFiles,CompactSQL2005,FlexNetConnect,FusePlatform,LanguageIndependent,RatataskPlatform,SpecSaversOnly /quiet' }
#(software installs, software does not register) I found the failure is the registration.exe tool
invoke-command -computername MYPC -scriptblock {start-process -NoNewWindow -FilePath 'C:\Installs\Software\Files\program files\Software\Noah4RegistrationTool.exe' -ArgumentList '/R /P "C:\Program Files (x86)\Software\Software.exe" /L "C:\Program Files (x86)\Software\Software\Logo.dll" /I 3 /M 35 /N "Software 1.5"'}
#(software doesn't register) No errors are produced and event viewer shows no errors
使用enter-pssession远程运行:

enter-pssession
start-process -NoNewWindow -FilePath 'C:\Installs\Software\Files\program files\Software\Noah4RegistrationTool.exe' -ArgumentList '/R /P "C:\Program Files (x86)\Software\Software.exe" /L "C:\Program Files (x86)\Software\Software\Logo.dll" /I 3 /M 35 /N "Software 1.5"'
#(software doesn't register) No errors are produced and event viewer shows no errors
使用PSEXEC注册:

cmd /c '"C:\Installs\Software\Files\program files\Software\Noah4RegistrationTool.exe" /R  /P "C:\Program Files (x86)\Software\Software.exe" /L "C:\Program Files (x86)\Software\Software\Logo.dll" /I 3 /M 35 /N "Software 1.5"'
#(software doesn't register)

您可能需要发布一些代码,以便我们确定问题可能在哪里。请将代码添加到您的问题中,而不是添加到注释中。您必须确定是UAC阻止了您还是工具本身。如果您能够在UAC被停用的客户端上测试安装,这可能值得一试。也可能有帮助。通过
invoke命令
远程运行注册工具时,如何检查该工具是否抛出任何错误?您是否愿意删除您现在已经过时的评论?;-)谢谢。我没有用invoke命令检查错误,因为我切换到进入Pssession,这给了我一个交互式会话,但没有抛出错误。MyPC位于受保护的OU中,并且已禁用UAC。msi工作并返回“0”,如果它是UAC,则只有注册件不工作,这似乎很奇怪。我刚刚在另一台机器上使用enter-pssession运行了注册,我刚刚关闭了UAC,但仍然没有GO注册工具返回什么?您可以使用
$lastexticode
进行检查。也许你有可能用这个工具写日志?如果这不能提供任何有用的信息,我恐怕我已经没有主意了,因为没有调试信息,我们只能猜测。