Jump to content
Van Der Hoff ICT

Script on multiple systems

Recommended Posts

Posted (edited)

Hi,

We created a script which checks for Windows Updates, installs the updates, creates a report and reboots if necessary. 
This script runs in a single task and every system has it's own scheduled task. Unfortunately when I check the Script Output Results (where our report file is shown), I noticed the following error:

 "Download Status: 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))()"
(See the attachment for a more detailed Script Output, the script is also attached.)

I tried the following:
- Run the script locally on a system > Runs successfully. (Probably permission error?)
- Enabled the Powershell User Impersonation in the Pulseway Agent Manager (Administrator permissions) > Same error.
- Tried using SubInACL to fix (https://answers.microsoft.com/en-us/windows/forum/windows_7-windows_update/windows-update-error-0x80070005-need-a-fix-click/e4cb8700-f215-4f1a-8bd4-6457ac619c19) > SubInACL error: "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing - RegSetKeySecurity Error : 5 Access is denied." > Still not fixed.

I keep getting this error on a dosin of systems but can't figure out what the exact cause/problem is.

Facts:
- Not Windows Server version related > Error occurs on multiple Windows Server versions.
- Script runs successfull locally on systems.

Any ideas?

Output example.txt Script.txt

Edited by Van Der Hoff ICT

Share this post


Link to post
Share on other sites

Hi @Van Der Hoff ICT,

Have you tried to use our bult-in script to install these updates? For more details please check out the following link.

From the error log I can see that you are trying to call download on the array element which is null. If you want to troubleshoot this error then please verify that that element in array is not null.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...