Failing remotely WSUS patching for detect, download, and Install patches

-1

Writing PowerShell automation using the PSWindowsUpdate Module to detect, download, and install patches remotely. Seems PowerShell script working manually on VM itself with DownloadStatus as success and the result as below.

{ "DownloadedPatchStatus": "{"Date": "07/10/2020 11:59:55","ComputerName": "*******","DownloadStatus": "SUCCESS","UpdateTitle": "2018-12 Cumulative Update for Windows Server 2019 for x64-based Systems (KB4483235)"rn}" }

However, if we run those PowerShell scripts remotely it failed DownloadStatus as FAILED with Error as below.

{ "Date": "28/09/2020 15:08:59", "DownloadStatus": "FAILED With Error -- You cannot call a method on a null-valued expression. The property 'Updates' cannot be found on this object. Verify that the property exists and can be set. Exception calling "CreateUpdateDownloader" with "0" argument(s): "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"()", "ComputerName": "**********", "UpdateTitle": "Security Update for Windows Server 2012 R2 (KB2922229)" }**

However, if we run those PowerShell scripts remotely it failed InstallStatus as FAILED with Error as below.

{ "Date": "07/10/2020 11:54:31", "InstallStatus": "FAILED With Error -- You cannot call a method on a null-valued expression. The property 'Updates' cannot be found on this object. Verify that the property exists and can be set. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))()", "ComputerName": "*******", "UpdateTitle": "2018-12 Cumulative Update for Windows Server 2019 for x64-based Systems (KB4483235)" }**

What I have tried to troubleshoot this?

Ans: We are using AD for group policies management where we set the Windows Update component policy as "Auto-Download and Nofity for Install" and remote PowerShell component policy has enabled and set to run "All Scripts". Also, we refer to the below link to enable firewall rules, seems it also not work for us.

https://gallery.technet.microsoft.com/scriptcenter/2d191bcd-3308-4edd-9de2-88dff796b0bc/view/Discussions/21

Any help is most appreciated !!!

Note: This automation is for Windows server 2012, 2016, 2019, etc families.

python-3.x
windows
powershell-remoting
azure-automation
winrm
asked on Stack Overflow Oct 8, 2020 by Ganesh Bodkhe • edited Oct 8, 2020 by Ganesh Bodkhe

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0