Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Servers, nginx and Docker

wbemtest or a WMI script gets Access is denied from a remote PC

Your error

0x80070005 Access is denied1 more line it can show

Fix it fast

Most common cause, 1 of 3

A local administrator account in a workgroup is filtered by remote UAC

The approach Microsoft prefers is a dedicated local user for remote WMI, given DCOM remote launch, activation and access plus Remote Enable on the namespace (the steps in cause 2).

Fix
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

WMI error 0x80070005 (Access is denied, -2147024891) is a DCOM refusal. Usually the account is a local, non-domain admin whose rights UAC strips on remote logons, or a non-admin with no DCOM remote launch, activation and access rights. On Windows 11 and Server 2025, connect as a domain admin of the target, or grant those DCOM rights plus Remote Enable.

  • Applies to Windows 11 25H2 and 26H2, Windows Server 2025, PowerShell 7.7
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

On the target computer, find out whether it belongs to a domain and whether remote UAC filtering has been changed. A workgroup machine with no LocalAccountTokenFilterPolicy value points to cause 1; a domain machine points to cause 2.

Run this first
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object Name, PartOfDomain, Workgroup
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy

Then find the line you see in this list and open its fix:

  1. 1A local administrator account in a workgroup is filtered by remote UACPartOfDomain is False, you connect as TARGET\someadmin, and the same account works when you sign in at the target itself
  2. 2The account is not an administrator on the target and has no DCOM remote rightsYou use a domain or local account that is outside the target's Administrators group; adding it to that group makes the error stop
  3. 3The tool runs without elevation on the machine itselfThe access denied appears even on the target computer, and goes away when the same command runs from an elevated window

What does the error look like?

  • 0x80070005 Access is denied
  • DCOM Access Denied (decimal -2147024891, hex 0x80070005)

Cause 1 of 3

A local administrator account in a workgroup is filtered by remote UAC

You seePartOfDomain is False, you connect as TARGET\someadmin, and the same account works when you sign in at the target itself

Check

Microsoft's UAC and WMI page explains the 0x80070005 Access is denied result for workgroups: a local account in the Administrators group still connects as a standard user from another machine, because UAC hands remote logons a filtered token. Being an admin on paper is not enough.

Check
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy

Fix

The approach Microsoft prefers is a dedicated local user for remote WMI, given DCOM remote launch, activation and access plus Remote Enable on the namespace (the steps in cause 2). Turning remote UAC off is described as not recommended, though sometimes needed in a workgroup: a value of 1 disables the filtering, 0 keeps it on. Run it on the target only if you accept that risk.

Fix
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f

Verify

From the other computer, connect wbemtest to the target's root\cimv2 namespace again. It opens, and a query on a class such as Win32_Process returns rows.

Verify
SELECT * FROM Win32_Process

Confirmed by learn.microsoft.com

Did this fix it?

Cause 2 of 3

The account is not an administrator on the target and has no DCOM remote rights

You seeYou use a domain or local account that is outside the target's Administrators group; adding it to that group makes the error stop

Check

Only members of Administrators may connect to WMI remotely by default. Microsoft's guide on securing a remote WMI connection names DCOM Access Denied, hex 0x80070005, as the error any other account receives until DCOM rights are granted on the target.

Check
dcomcnfg

Fix

On the target, open DCOMCNFG, then Component Services, Computers, right-click My Computer, Properties, COM Security. Under Launch and Activation Permissions choose Edit Limits and allow Remote Launch and Remote Activation for the account. Under Access Permissions choose Edit Limits and allow Remote Access. Next run wmimgmt.msc, open Properties, Security tab, select the namespace (for example root\cimv2), click Security and tick Remote Enable for the same account.

Fix
wmimgmt.msc

Verify

wbemtest connects from the other machine. If the error now reads 0x80041003 instead, DCOM is fixed and only the namespace Remote Enable right is still missing.

Verify
wbemtest

Confirmed by learn.microsoft.com

Did this fix it?

Cause 3 of 3

The tool runs without elevation on the machine itself

You seeThe access denied appears even on the target computer, and goes away when the same command runs from an elevated window

Check

Locally, an administrator under UAC holds two tokens and normal windows use the standard-user one. Microsoft notes that WMI scripts then fail with access denied when the operation needs admin rights, and the script has no way to tell which token it got.

Check
Get-CimInstance -ClassName Win32_ComputerSystem

Fix

Right-click Command Prompt or PowerShell and pick Run as administrator, then repeat the call. For a job that runs on a timer, let Task Scheduler start it elevated.

Fix
Start-Process -FilePath "powershell" -Verb RunAs

Verify

The query that failed returns data in the elevated window.

Verify
Get-CimInstance -ClassName Win32_Process

Confirmed by learn.microsoft.com

Did this fix it?

How do I stop it coming back?

  • In a domain, connect with a domain account that sits in the target's Administrators group instead of a local account on that computer.
  • Create one local monitoring account per workgroup server with exactly the DCOM rights and namespace Remote Enable it needs, and note those grants in your server build script.
  • Record any LocalAccountTokenFilterPolicy change in your hardening checklist so it can be reviewed and reverted later.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.