I've been working with PSWindowsUpdates for quite some time, using it on over 2000 devices. However, I'm facing an issue with about 10-15 specific devices that throw the error "Access is denied (0x80070005 (E_ACCESSDENIED))". I've ensured that PowerShell is running as an administrator and even tried remote sessions, along with using PSexec to execute PowerShell commands. I suspected it might be related to the SCCM client, so I completely uninstalled it along with its policies and registry keys. I've also removed EPM and antivirus software, reset Group Policy Objects, and cleared all firewall rules. I'm currently on PowerShell version 7.4.13 and still can't figure out what's causing this access denial. Any help would be greatly appreciated! Here's a text example of the command and error I'm encountering:
PS C:WindowsSystem32> Get-WindowsUpdate -MicrosoftUpdate -Computer HOSTNAME01
Get-WindowsUpdate: Access is denied. (0x80070005 (E_ACCESSDENIED))
4 Answers
From what I understand, running Windows updates remotely can often hit API restrictions. You might want to use the `Invoke-WUJob` cmdlet instead of the usual commands. You can also use CIM cmdlets to kick off the update checks locally instead.
Have you tried using Sysinternals' Process Monitor to look for e_access_denied events? There might be some naming conflicts or issues with your security settings like AppLocker or antivirus software that's interfering.
It sounds like your Group Policy Object settings might be preventing you from receiving a full admin token when using remote PowerShell. I'd check the LocalAccountTokenFilterPolicy to see if that's the issue.
Keep in mind that PSWindowsUpdate hasn’t been updated in a while, and Microsoft has been implementing stricter security on Windows. If you're able, upgrade your setup; you might find that using the native cmdlets after the update resolves these issues.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures