【问题标题】:Does anyone knows how to use the slmgr /ipk using PS AppDeployToolkit?有谁知道如何使用 PS AppDeployToolkit 使用 slmgr /ipk ?
【发布时间】:2020-07-05 03:55:32
【问题描述】:

有人知道如何通过 PS AppDeployToolkit 使用 slmgr /ipk 吗? 我正在尝试创建一个应用程序,它将自动为 Windows 7 计算机安装新的产品密钥,作为 Microsoft 的 ESU(扩展安全更新)的一部分。

【问题讨论】:

    标签: windows powershell window sccm activation


    【解决方案1】:

    PSAppDeployment-Toolkit 包含 cmdlet Execute-Process 以运行带参数的可执行文件。

    “slmgr”不是可执行文件。它是一个 VB 脚本。 (slmgr.vbs)
    您可以使用cscript.exe 运行 VB 脚本并调用 slmgr.vbs。

    代码可能如下所示:

    $Status = Execute-Process -Path cscript.exe -Parameters "$env:windir\System32\slmgr.vbs","/ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx" -PassThru -Verbose
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多