1

有没有人有幸使用 WebPICmd.exe 远程自动安装 .NET Framework 4。我正在尝试使用 PowerShell 来执行此操作,但它似乎不起作用。

PS C:> ([wmiclass]"\webserver1\root\cimv2:Win32_Process").Create("D:\installer_tools\webpicmd\webpicmd.exe /Install /Products:NETFramework4 /AcceptEula", "D:\installer_tools\webpicmd\")


要添加更多详细信息,我不断收到此错误:
Exe (C:\Users\rh\AppData\Local\Temp\Microsoft .NET Framework 4 Setup_4.0.30319\Windows6.1-KB958488-v6001-x64.msu) failed with 0x5 - Access is denied.

4

2 回答 2

2

我可以让它工作的唯一方法是使用 sysinternals 中的 PsExec.exe 工具并使用 /s 选项让进程在系统帐户下运行。只是认为其他人可能会发现此信息有帮助。

SysInternals PsTools 下载 http://technet.microsoft.com/en-us/sysinternals/bb896649

选项 1 - 使用 .NET Framework 4 完整安装程序

.\_tools\PsTools\PsExec.exe \\WebServer1 /S /AcceptEula C:\installer\dotNetFx40_Full_x86_x64.exe /q /norestart

选项 2 - 使用 WebPiCMD.exe

.\_tools\PsTools\PsExec.exe \\WebServer1 /S /AcceptEula C:\installer\_tools\WebPiCMD\WebPICMD.exe /Install /Products:NetFramework4 /AcceptEula

在上述选项之一之前使用以下代码下载 PSExec 工具:

# Download Psexec
    $psToolsPath = "$env:temp\pstools"
    New-Item $psToolsPath -ItemType directory -force -erroraction silentlycontinue
    Invoke-WebRequest -Uri https://download.sysinternals.com/files/PSTools.zip -OutFile $psToolsPath\PSTools.zip

    #Expand and execute as local system
    Expand-Archive "$psToolsPath\PSTools.zip" $psToolsPath -force
    cd $psToolsPath
于 2012-03-19T18:54:13.347 回答
0

要添加 roberto 的答案(尚无法评论),请在他的答案中的一个选项之前使用以下代码下载 PSExec 工具:

# Download Psexec
    $psToolsPath = "$env:temp\pstools"
    New-Item $psToolsPath -ItemType directory -force -erroraction silentlycontinue
    Invoke-WebRequest -Uri https://download.sysinternals.com/files/PSTools.zip -OutFile $psToolsPath\PSTools.zip

    #Expand and execute as local system
    Expand-Archive "$psToolsPath\PSTools.zip" $psToolsPath -force
    cd $psToolsPath
于 2019-04-17T21:51:41.127 回答