mgajda83 / PSWindowsUpdate

This module contain cmdlets to manage Windows Update Client.
MIT License
253 stars 24 forks source link

Install-WindowsUpdate via Remote Call fails due to insufficient permissions #17

Open JochenEckwerth opened 3 months ago

JochenEckwerth commented 3 months ago

Our Powershell script operates from a central machine and cycles thru a bunch of virtual machines (Win2019, Win2022) in order to install the existing Windows updates using cmdlet "Install-WindowsUpdate".

eg. ..... $Computer="SRV37V162" Invoke-Command -ComputerName ($Computer) {Install-WindowsUpdate -ForceInstall -Verbose -AcceptAll} .....

However, this results in the following error:

VERBOSE: Accepted [1] Updates ready to Download Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

The Powershell is executed with Administrator privileges.

Jochen Eckwerth Kaufmännische Krankenkasse Hannover

MaKaNu commented 3 months ago

Funny we have similiar issue just at the same moment

areis422 commented 2 months ago

Also seeing a similar issue:

Get-WUList -Verbose -Debug -AcceptAll -Install -IgnoreReboot -Computername HOSTNAME

DEBUG: 5/1/2024 10:15:47 AM ParameterSetName: Default
DEBUG: 5/1/2024 10:15:47 AM Set pre search criteria: IsInstalled = 0
DEBUG: 5/1/2024 10:15:47 AM Set pre search criteria: IsHidden = 0
DEBUG: 5/1/2024 10:15:47 AM Search criteria is: IsInstalled = 0 and IsHidden = 0
DEBUG: 5/1/2024 10:15:47 AM HOSTNAME: Connecting...
DEBUG: 5/1/2024 10:15:48 AM Module version: 2.2.1.4
DEBUG: 5/1/2024 10:15:48 AM Dll version: 2.2.1.4
DEBUG: 5/1/2024 10:15:49 AM UpdateSessionObj mode: Activator

Confirm
HOSTNAME: Unknown failure.
[Y] Yes  [A] Yes to All  [H] Halt Command  [S] Suspend  [?] Help (default is "Y"): a
get-wulist : HOSTNAME: Unknown failure.
At line:1 char:1
+ get-wulist -Verbose -Install -AcceptAll -IgnoreReboot -ComputerName @ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (:) [Get-WindowsUpdate], Exception
    + FullyQualifiedErrorId : Unknown,PSWindowsUpdate.GetWindowsUpdate

This is after running Enable-WURemoting

patch-work commented 4 weeks ago

get-help Invoke-WUJob