PDQ Deploy Enterprise "Add-WindowsCapability"

0

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

Cancel
login to comment
1

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

Cancel
login to comment

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.

Cancel
login to comment

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

Cancel
login to comment

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
Cancel
login to comment

0

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

Cancel
login to comment

Reply