Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Answered

PDQ Deploy Enterprise "Add-WindowsCapability"

We are currently evaluating Enterprise and a key feature for us is to be able to use the Powershell command Add-Windows Capability.

I have created a PS command step containing Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 but it errors out with the generic: At C:\WINDOWS\AdminArsenal\PDQDeployRunner\service -1\exec\Error Handling Wrapper.ps1:58 char:2 error.

I have tried running as different user types to no avail.

Other commands, msi install, etc work fine. The errors are limited to running the Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 command.

Any ideas?

EDIT: Accepted Wei's answer as correct, but if you don't want to mess with the registry, and can use Group Policy, use:

Computer Configuration > Administrative Templates > System > Specify settings for optional component installation and component repair > Contact Windows Update directly

0

Comments

5 comments
Date Votes
  • What happens when you run it manually from one of those machines using any of the credentials you used to test the deployment?

    0
  • This is a known issue.

    The workaround is Change the following reg key value to 0 from 1

    \HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\UseWUServer

    reboot -> run Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 -> Change the reg key value back to 1 -> reboot

    0
  • @Brodiemac It works fine when run manually/locally on the systems.

    @Wei Can you explain what affect that has on this? I have tried with machines that are both connected to and not connected to our WSUS server, with the same results.

    0
  • Check the event viewer of your target, see if there are any "1001" events ( under Windows Logs -> Application). It should tell you why Add-WindowsCapability failed.
    https://github.com/MicrosoftDocs/windowsserverdocs/issues/2074

    0
  • @Wei you were actually correct.

    Fixed with GPO:

    Computer Configuration > Administrative Templates > System > Specify settings for optional component installation and component repair > Contact Windows Update directly
    
    0